update:动态表格优化

This commit is contained in:
2025-11-04 15:55:47 +08:00
parent 8431e28f02
commit 0674563cbc
2 changed files with 24 additions and 2 deletions

View File

@@ -162,10 +162,17 @@ watch(() => props.searchItems, (val) => {
}, { deep: true, immediate: true });
onMounted(() => {
initFun();
});
const initFun = () => {
current.value = 1;
searchData.value = {};
if (!props.head) {
getHeadDataFun();
}
});
};
// 获取表头数据
const getHeadDataFun = () => {
const params = {
@@ -297,6 +304,10 @@ const searchLoadFun = () => {
emit('load');
};
watch(() => props.tableName, () => {
initFun();
}, { deep: true, immediate: true });
defineExpose({
tableData,
tableRef: vxeTableRef,

View File

@@ -173,10 +173,17 @@ watch(() => props.searchItems, (val) => {
}, { deep: true, immediate: true });
onMounted(() => {
initFun();
});
const initFun = () => {
current.value = 1;
searchData.value = {};
if (!props.head) {
getHeadDataFun();
}
});
};
// 获取表头数据
const getHeadDataFun = () => {
const params = {
@@ -312,6 +319,10 @@ const removeFun = (data: any) => {
}
};
watch(() => props.tableName, () => {
initFun();
}, { deep: true, immediate: true });
defineExpose({
tableData,
treeTableRef: vxeTableRef,