其他分享
首页 > 其他分享> > 解决:Filters are deprecated.eslint-plugin-vue

解决:Filters are deprecated.eslint-plugin-vue

作者:互联网

原因:从vue3.0开始,过滤器就被移除了。

解决:使用方法调用或计算属性来替换它们。

<el-table-column prop="bookType" label="图书类型" width="100">
            <template v-slot="scope">
                <span>{{bookTypeFilter(scope.row.bookType)}}</span>
            </template>
        </el-table-column>
 methods: {
        
        bookTypeFilter(type) {
            const booktypeobj = bookTypeOptions.find(obj => obj.type === type);
            return booktypeobj ? booktypeobj.name : null;
        }
    }

 

标签:vue,obj,methods,plugin,deprecated,bookTypeFilter,booktypeobj,null,type
来源: https://www.cnblogs.com/tszr/p/16450530.html