https://blog.csdn.net/QQ_Empire/article/details/90173641
1,声明一个全局变量
let that;
2,在生命周期 beforeCreate里面改变this指向
beforeCreate: function () {
that = this;
},
filters: {
ifsex(val) {
return IFSEX[val]
},
formatDate(value) {
return formatDate(value, 'yyyy-MM-dd')
},
caseType(value) {
if (that.caseTypeArr.find(i => {
return i.dictValue == value
})) {
return that.caseTypeArr.find(i => {
return i.dictValue == value
}).dictName
}
}
},
————————————————