【发布时间】:2021-07-20 18:05:55
【问题描述】:
为什么关键字'this'可以访问不在同一个对象中的任务?
anyobject = {
template: '#task-list',
props: {
tasks: {default: []}
},
data() {
return {
newTask: ''
};
},
computed: {
incomplete() {
return this.tasks.length; // I DONT UNDERSTAND HOW THIS WORKS HERE
}
},
【问题讨论】:
标签: javascript vue.js object