使用elementplus,如何在js中,将后端传的数字改为指定的值?
这是js
const column = reactive([
{ prop: "name", label: "姓名", minWidth: 60 },
{ prop: "id", label: "工号ID", minWidth: 160 },
{ prop: "position", label: "岗位", minWidth: 60 },
{ prop: "status", label: "状态", minWidth: 60 },
]);
<el-table-column
v-for="column in columns"
:key="column.prop"
:prop="column.prop"
:label="column.label"
:min-width="column.minWidth"
show-overflow-tooltip
>
我想要把status的值:1,2改为“在线”,“离线”,但我用了v-if,以及三目运算,都提示我语法错误,应该怎么做?