-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Closed
Description
版本号:
3.6.2 (ffc79bc)
问题描述:
BasicTable在使用clickToRowSelect=true的状态下,selection-change 事件在每次选中项切换后会触发多次。设置clickToRowSelect=false,表现正常。
截图&代码:
<BasicTable @register="registerTable" :rowSelection="rowSelection" @selection-change="selectionChangeEvent">
(...)
</BasicTable>
<script lang="ts" name="ProjectInfo" setup>
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '主项目',
api: queryIndex,
rowKey: 'id',
rowSelection: { type: 'radio' },
columns,
canResize: true,
minHeight: 500,
clickToRowSelect: true,
formConfig: {
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
fieldMapToNumber: [],
fieldMapToTime: [],
},
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
params.isChildren = '0';
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: 'project_info',
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
(...)
function selectionChangeEvent(sel) {
console.log("event happening, timestamp:"+Number(new Date()));
}
</script>
每次选中项切换,产生多次事件,但点击“清空”只产生一次事件。
友情提示(为了提高issue处理效率):
- 未按格式要求发帖,会被直接删掉;
- 请自己初判问题描述是否清楚,是否方便我们调查处理;
- 描述过于简单或模糊,导致无法处理的,会被直接删掉;
Metadata
Metadata
Assignees
Labels
No labels