From ccf4027533d2adabd21bade025ca7bc7d34d75f6 Mon Sep 17 00:00:00 2001 From: invalid w Date: Wed, 13 Dec 2023 17:35:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(ApiSelect):=20=E4=BF=AE=E5=A4=8D=E7=9B=91?= =?UTF-8?q?=E5=90=AC=E4=B8=8D=E5=88=B0params=E7=9A=84=E5=8F=98=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/components/ApiSelect.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Form/src/components/ApiSelect.vue b/src/components/Form/src/components/ApiSelect.vue index a7b0cba79..f1c74e77b 100644 --- a/src/components/Form/src/components/ApiSelect.vue +++ b/src/components/Form/src/components/ApiSelect.vue @@ -26,7 +26,7 @@ import type { SelectValue } from 'ant-design-vue/es/select'; import { isFunction } from '@/utils/is'; import { useRuleFormItem } from '@/hooks/component/useFormItem'; - import { get, omit } from 'lodash-es'; + import { get, omit, isEqual } from 'lodash-es'; import { LoadingOutlined } from '@ant-design/icons-vue'; import { useI18n } from '@/hooks/web/useI18n'; import { propTypes } from '@/utils/propTypes'; @@ -95,8 +95,9 @@ watch( () => props.params, - () => { - !unref(isFirstLoaded) && fetch(); + (value, oldValue) => { + if (isEqual(value, oldValue)) return; + fetch(); }, { deep: true, immediate: props.immediate }, );