我是 Vue 的新手。我想知道计算中的函数被调用了多少次,所以我写了这个组件:
const ComputedCounter = {
name: "ComputedCounter",
template: `
<span>{{ value }}</span>
`,
computed: {
value() {
const current = this.value || 0;
return current + 1;
}
}
}
但是,会抛出“渲染错误:“内部错误:递归过多””错误。我很困惑,这里发生了什么,有没有办法使这项工作?
千万里不及你
慕标琳琳
Qyouu
相关分类