vue.js methods中的方法互相调用

方法一:

new Vue({
    el: '#app',
  data: {
      test:111,
  },
  methods: {
      test1:function(){
            alert(this.test)
        },
        test2:function(){
            alert("this is test2")
        },
        test3:function(){
            this.$options.methods.test2();
        }
  }
})
方法二:
 methods: {
      test1:function(){
            alert(this.test)
        },
        test2:function(){
            alert("this is test2")
        },
        test3:function(){
            this.test2();
        }
  }
 
posted @ 2018-05-23 11:37  miny_simp  阅读(1165)  评论(0编辑  收藏  举报