vue中filters的用法

vue中filters的用法

一、代码

 <el-table-column prop="taskStatus" label="处理状态" align="left">
    <template slot-scope="scope">
    //scope.row.taskStatus为1,2,3
           {
    
    {
    
     scope.row.taskStatus | typeFilter }}
     </template>
 </el-table-column>
filters: {
    
    
   typeFilter(val) {
    
    
        let typeData = {
    
    
            1: '生成中',
            2: '生成成功',
            3: '生成失败',
        }
        return typeData[val]
    },
},

猜你喜欢

转载自blog.csdn.net/MISS_zhang_0110/article/details/121291416