数据源如下
tableData: [
{
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
},
{
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄',
},
{
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄',
},
{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄',
},
],
cols: [
{
prop: 'date',
label: '日期',
otherProps: {
type: 'index',
align: 'center',
},
},
{
prop: 'name',
label: '姓名',
otherProps: {
type: 'index',
align: 'center',
},
},
{
prop: 'address',
label: '地址',
},
{
prop: 'action',
label: '操作',
btnList: [
{
label: '编辑',
click:'add',
originProps: {
type: 'text',
style: { color: '#2478E9' },
},
},
{
label: '删除',
},
],
},
],
当给模板添加上slot-scope时,列数据就不显示了,没有报错,应该如何修改
slot部分
<template v-if="col.btnList" v-slot="scope">
.....
</template>