You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/_util/wave/useWave.ts

22 lines
525 B

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;
}