From d140523c899773894cd0bf9c08456a7ba2a31efa Mon Sep 17 00:00:00 2001 From: puppetkkk <45839282+puppet-666@users.noreply.github.com> Date: Mon, 18 Dec 2023 10:41:50 +0800 Subject: [PATCH] fix: useWave unref (#7108) * fix: useWave unref * fix: wave init value * fix: wave value * Update useConfigInject.ts --------- Co-authored-by: pangzebang Co-authored-by: tangjinzhou <415800467@qq.com> --- components/_util/wave/useWave.ts | 4 ++-- components/config-provider/hooks/useConfigInject.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/_util/wave/useWave.ts b/components/_util/wave/useWave.ts index 7c5a24f22..84e2a6eff 100644 --- a/components/_util/wave/useWave.ts +++ b/components/_util/wave/useWave.ts @@ -5,12 +5,12 @@ import showWaveEffect from './WaveEffect'; export default function useWave( instance: ComponentInternalInstance | null, className: Ref, - wave: ComputedRef<{ disabled?: boolean }>, + wave?: ComputedRef<{ disabled?: boolean }>, ): VoidFunction { function showWave() { const node = findDOMNode(instance); - if (wave.value?.disabled || !node) { + if (wave?.value?.disabled || !node) { return; } diff --git a/components/config-provider/hooks/useConfigInject.ts b/components/config-provider/hooks/useConfigInject.ts index 0c781d0f5..284c1d2e5 100644 --- a/components/config-provider/hooks/useConfigInject.ts +++ b/components/config-provider/hooks/useConfigInject.ts @@ -44,7 +44,7 @@ export default (name: string, props: Record) => { const csp = computed(() => props.csp ?? configProvider.csp); const wave = computed<{ disabled?: boolean; - }>(() => props.wave ?? configProvider.wave.value); + }>(() => props.wave ?? configProvider.wave?.value); return { configProvider,