diff --git a/package/component/src/component/table/index.vue b/package/component/src/component/table/index.vue index b6befb19..be2696b4 100644 --- a/package/component/src/component/table/index.vue +++ b/package/component/src/component/table/index.vue @@ -448,22 +448,13 @@ const classes = computed(() => { }); watch( - () => props.height, + () => [props.height, props.maxHeight, props.dataSource], () => { nextTick(() => { getScrollWidth(); - }); + }) } -); - -watch( - () => props.maxHeight, - () => { - nextTick(() => { - getScrollWidth(); - }); - } -); +) onMounted(() => { getScrollWidth(); diff --git a/package/component/src/utils/withInstall.ts b/package/component/src/utils/withInstall.ts index 8c6ba981..cbb7e465 100644 --- a/package/component/src/utils/withInstall.ts +++ b/package/component/src/utils/withInstall.ts @@ -10,4 +10,4 @@ export const withInstall = (comp: T): T & Plugin => { }; return component as T & Plugin; -}; +}; \ No newline at end of file