methods: {
testFunc() {
console.log('OK');
}
},
mounted() {
setTimeout(function(){
this.testFunc(); // エラー
}, 1000);
}
this.testFunc() だとエラー。以下に訂正
mounted() {
var self = this;
setTimeout(function(){
self.testFunc(); // OK
}, 1000);
}
参考: