因此,我试图在Vue数据属性内定义一个函数,但是当我console.log()
数据时,这些函数根本没有记录。
echo: {
description: 'Echoes the given input.',
task: () => {
let x = this.getInput();
return x;
}
}
这是给定的日志:
Error in render: "TypeError: Cannot read property 'task' of undefined"
是否有保留功能的方法? 感谢您的帮助。