過濾器
在開發中后台傳過來的數據是數組,在前台展示的時候需要轉化為文字 0-銷售聯系人、1-系統賬號、2-公司聯系人
所以用過濾器轉化一下
<el-table-column prop="city" label="聯系人類型" min-width="100">
<template slot-scope="scope">
{{ scope.row.type | statusFormat }}
</template>
</el-table-column>
filters: {
//聯系人對話框中 過濾器
statusFormat:function(input){
let str = "_";
switch(input){
case 0:
str="銷售聯系人"
break
case 1:
str="系統賬號"
break
case 2:
str="公司聯系人"
break
}
return str
}
}
展示出來的狀態為: