vue @Component ,filters 中怎么使用data中定义的数据,怎么使用this?
尝试在data
中定义that:this
,然后在formatDisplayType
这个方法里面调用还是不对,应该怎么写呢?
@Component({
components: {
Upload,
UploadStream
},
filters: {
formatDisplayType: function(val: any) {
},
}
})
在
created
中让app = this
,然后就可以在vue @Component ,filters
中使用this
了。