この中でのVue

結合10イベント

これは、インスタンスオブジェクトのVM Vueの方法の中で

var vm = new Vue({
            el: '#app',
            data: {
                num: 0
            }, // 注意点: 这里不要忘记加逗号 
            // methods  中 主要是定义一些函数
            methods: {
                handle: function() {
                    // 这里的this是Vue的实例对象+
                    console.log(this === vm) //结果输出true
                        //   在函数中 想要使用data里面的数据 一定要加this 
                    this.num++;
                }
            }
        });

おすすめ

転載: www.cnblogs.com/songsongblue/p/11963416.html