
<template slot-scope="scope"> slot-scope="scope"代表插槽的意思,这里 scope 代表行 data。scope.row取整行数据
<el-table-column
label="交易状态">
<template slot-scope="scope">
{{
scope.row.order_state== 1
? "待发货"
: scope.row.order_state== 2
? "待收货"
: scope.row.order_state== 3
? "代付款"
: scope.row.order_state== 4
? "已完成"
: scope.row.order_state == 5
? "已取消"
: ""
}}
</template>
</el-table-column>
本文介绍了如何使用Element UI的table组件,通过模板插槽实现根据订单状态显示不同文案。展示了如何根据不同order_state值,动态呈现'待发货'、'待收货'等状态,适合前端开发者理解与实践。
8989

被折叠的 条评论
为什么被折叠?



