提交 bcad95d3 作者: 无木

fix(form): fix form update problem

修复表单组件在特定情况下的卡顿、崩溃问题
fix: #720
上级 125a7d14
...@@ -7,6 +7,7 @@ import { computed, unref, watch } from 'vue'; ...@@ -7,6 +7,7 @@ import { computed, unref, watch } from 'vue';
import { isBoolean, isFunction, isNumber, isObject } from '/@/utils/is'; import { isBoolean, isFunction, isNumber, isObject } from '/@/utils/is';
import { useBreakpoint } from '/@/hooks/event/useBreakpoint'; import { useBreakpoint } from '/@/hooks/event/useBreakpoint';
import { useDebounceFn } from '@vueuse/core';
const BASIC_COL_LEN = 24; const BASIC_COL_LEN = 24;
...@@ -49,12 +50,14 @@ export default function ({ ...@@ -49,12 +50,14 @@ export default function ({
return 0; return 0;
}); });
const debounceUpdateAdvanced = useDebounceFn(updateAdvanced, 30);
watch( watch(
[() => unref(getSchema), () => advanceState.isAdvanced, () => unref(realWidthRef)], [() => unref(getSchema), () => advanceState.isAdvanced, () => unref(realWidthRef)],
() => { () => {
const { showAdvancedButton } = unref(getProps); const { showAdvancedButton } = unref(getProps);
if (showAdvancedButton) { if (showAdvancedButton) {
updateAdvanced(); debounceUpdateAdvanced();
} }
}, },
{ immediate: true } { immediate: true }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论