vue-created调用mothods中的方法
正常调用可采取以下
created: function() {
this.$options.methods.loadLinks();
},
methods: {
loadLinks: function() {
}
}
但是有时候methods方法中需要用到data中数据,由于生命周期原因,可采取如下:
created: function() {
this.$options.methods.loadLinks.bind(this)("");
},
methods: {
loadLinks: function() {
this.currentPage = 1;
}
}

浙公网安备 33010602011771号