Vue计算的功能不会针对语法错误进行编译

时间:2019-09-06 01:20:20

标签: javascript vue.js

我的Vue代码中有一个计算所得的元素,由于computed: { filtered() { return this.dataEvents .filter(dataEvent => !this.filters.title || dataEvent.title === this.filters.title), .filter(dataEvent => !this.filters.resource || dataEvent.resource === this.filters.resource), .filter(dataEvent => !this.filters.location || dataEvent.location === this.filters.location), .filter(dataEvent => !this.filters.status || dataEvent.status === this.filters.status); }, titles() { return this.dataEvents.map(dataEvent => dataEvent.title) .filter((title, index, self) => self.indexOf(title) === index); }, resources() { return this.dataEvents .map(dataEvent => dataEvent.resource) .filter((resource, index, self) => self.indexOf(resource) === index); }, locations() { return this.dataEvents .map(dataEvent => dataEvent.location) .filter((location, index, self) => self.indexOf(location) === index); }, statuses() { return this.dataEvents .map(dataEvent => dataEvent.status) .filter((status, index, self) => self.indexOf(status) === index); }, }, 周围第3/4行上的意外令牌而无法编译

从逻辑上看,这应该是正确的,但根本不会针对语法和令牌错误进行构建。

我在这里做什么错了?

{{1}}

0 个答案:

没有答案
相关问题