Vue filter方法中使用this
1.在data中定义that,赋值为this
data: function () {
return {
that: this
}
2. filters中使用参数val、that
filters: {
useBranchNoFormat(val,that) {
..........
}
}
3.使用filter时传入that
<template slot-scope="scope">
<span>{{ scope.row.F_UseBranchNo | useBranchNoFormat(that) }}</span>
</template>