mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 05:29:01 +08:00
d140523c89
* fix: useWave unref * fix: wave init value * fix: wave value * Update useConfigInject.ts --------- Co-authored-by: pangzebang <pangzebang@dm-ai.com> Co-authored-by: tangjinzhou <415800467@qq.com>
22 lines
527 B
TypeScript
22 lines
527 B
TypeScript
import type { ComponentInternalInstance, ComputedRef, Ref } from 'vue';
|
|
import { findDOMNode } from '../props-util';
|
|
import showWaveEffect from './WaveEffect';
|
|
|
|
export default function useWave(
|
|
instance: ComponentInternalInstance | null,
|
|
className: Ref<string>,
|
|
wave?: ComputedRef<{ disabled?: boolean }>,
|
|
): VoidFunction {
|
|
function showWave() {
|
|
const node = findDOMNode(instance);
|
|
|
|
if (wave?.value?.disabled || !node) {
|
|
return;
|
|
}
|
|
|
|
showWaveEffect(node, className.value);
|
|
}
|
|
|
|
return showWave;
|
|
}
|