1,声明一个全局变量

let that;

wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

2,在生命周期 beforeCreate里面改变this指向

 beforeCreate: function () {
     that = this;
 },
wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==
 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
                }
            }
        },
wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==

 

Logo

前往低代码交流专区

更多推荐