fix: 临时修复 GiTable 升级后代码生成配置页面卡死问题

This commit is contained in:
2025-03-27 21:33:49 +08:00
parent b135b49a87
commit cb297d2b9f

View File

@@ -66,6 +66,7 @@
:scrollbar="true"
:data="data"
column-resizable
@change="handleTableChange"
>
<template v-for="key in Object.keys(slots)" :key="key" #[key]="scope">
<slot :key="key" :name="key" v-bind="scope" />
@@ -97,6 +98,7 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits<{
(e: 'refresh'): void
(e: 'update:columns', columns: TableColumnData[]): void
(e: 'change', ...args: any[]): void
}>()
/** Slots 类型定义 */
@@ -217,6 +219,12 @@ const visibleColumns = computed(() => {
return props.columns?.filter((col) => col.show !== false) || []
})
// 处理表格变化的函数
const handleTableChange = (...args: any[]) => {
// 将接收到的参数传递给父组件
emit('change', ...args)
}
defineExpose({
tableRef,
resetColumns: () => columnSettingRef.value?.resetColumns?.(),