<el-tag v-if=" scope.row.status===2" type="danger">禁用</el-tag>
<el-tag v-if=" scope.row.status===1" type="success">启用</el-tag>
两个的简写
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">{{scope.row.status === 1 ? '启用':'禁用'}}</el-tag>
多个的简写
<el-tag v-for="(item,index) in menuCateMap" v-show="scope.row.type == item.value" :key="index" :type="item.cssName">
{{item.label}}
</el-tag>
js
menuCateMap: [
{ label: '菜单', value: 1, cssName: 'success' },
{ label: '目录', value: 2, cssName: 'primary' },
{ label: '按钮', value: 3, cssName: 'danger' },
{ label: '顶级菜单', value: 4, cssName: 'warning' },
{ label: '字段', value: 5, cssName: 'info' },
]
网友评论