Ant Design of Vue ,使用的是vue2
Ant Design的a-table,在最后一列添加了操作列,里面3个按钮,现在想根据行数据的一个值来让“导入”和“问题页”这两个按钮变成无法点击的(disabled )
:columns="columns" :data-source="datasource" :loading="options.loading" :bordered="true" size="middle"
:scroll="{ x: 1300 }" :pagination="pagination">
"operation" slot-scope="text, record">
"buttonColor" size="small" icon="upload" @click="sendQCT(record)">
导入
"buttonColor" size="small" icon="edit" @click="showEditModal(record)">
编辑
"buttonColor" size="small" icon="unordered-list" @click="showDetailsModel(record)">
问题页
。。。。。。。
const columns = [
。。。。。。
{
title: '操作',
key: 'operation',
width: '230px',
align: 'center',
scopedSlots: { customRender: 'operation' },
fixed: 'right',
},
];
现在:
需求(网上找的图,图中的领取和负责无法点击):
那你 给数据 里加两个 属性 (遍历数据 加 两个属性,默认为false)。来控制 按钮 disible 属性 。
比如:imp:true , qut:true 。然后 table里 scope 里 button 就可以 用这个属性控制