-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Description
版本号:3.5.5
前端版本:vue3
问题描述:表格某列禁止勾选后,点击表头全部勾选还是会选中。
截图&代码:
rowSelection: {
type: 'checkbox',
getCheckboxProps(record: Recordable) {
if (record.processStatus == 'approve' && record.stageStatus!='publicity') {
return { disabled: false };
} else {
return { disabled: true };
}
},
onChange(keys,rows){
console.log(keys)
console.log(rows)
}
},
官方vue3演示版 组件&功能>树形表格 有同样的问题
友情提示(为了提高issue处理效率):
- 未按格式要求发帖,会被直接删掉;
- 描述过于简单或模糊,导致无法处理的,会被直接删掉;
- 请自己初判问题描述是否清楚,是否方便我们调查处理;
- 针对问题请说明是Online在线功能(需说明用的主题模板),还是生成的代码功能;
Activity
zhangdaiscott commentedon Oct 13, 2023
zy
liaozhiyang commentedon Oct 17, 2023
已修复,下一版本发布。


你本地可按如下更改
src/components/Table/src/hooks/useCustomSelection.tsx
const flattedData = computed(() => {
const data = flattenData(tableData.value, childrenColumnName.value);
const rowSelection = propsRef.value.rowSelection;
if (rowSelection?.type === 'checkbox' && rowSelection.getCheckboxProps) {
for (let i = 0, len = data.length; i < len; i++) {
const record = data[i];
const result = rowSelection.getCheckboxProps(record);
if (result.disabled) {
data.splice(i, 1);
i--;
len--;
}
}
}
return data;
});
src/components/Table/src/components/CustomSelectHeader.vue

liwenpmz commentedon Jan 4, 2024
@zhangdaiscott 打包后会出现样式问题
liwenpmz commentedon Jan 4, 2024
打包后 全选按钮样式不生效 @zhangdaiscott
liwenpmz commentedon Jan 4, 2024
zhangdaiscott commentedon Jan 4, 2024
好像是vue版本号问题,固定版本号就好了