From 2a6c0f3b73d0dab7ace27adadfc148c00eba9bcd Mon Sep 17 00:00:00 2001 From: showkw Date: Mon, 14 Mar 2022 04:29:18 +0800 Subject: [PATCH] Fixed wave's custom prefixCls not working --- components/_util/wave.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/_util/wave.tsx b/components/_util/wave.tsx index a733fcbc54..c70ef41ddb 100644 --- a/components/_util/wave.tsx +++ b/components/_util/wave.tsx @@ -28,7 +28,7 @@ export default defineComponent({ }, setup(props, { slots, expose }) { const instance = getCurrentInstance(); - const { csp } = useConfigInject('', props); + const { csp, prefixCls } = useConfigInject('', props); expose({ csp, }); @@ -58,7 +58,7 @@ export default defineComponent({ }; const getAttributeName = () => { const { insertExtraNode } = props; - return insertExtraNode ? 'ant-click-animating' : 'ant-click-animating-without-extra-node'; + return insertExtraNode ? `${prefixCls.value}-click-animating` : `${prefixCls.value}-click-animating-without-extra-node`; }; const onClick = (node: HTMLElement, waveColor: string) => { const { insertExtraNode, disabled } = props; @@ -67,7 +67,7 @@ export default defineComponent({ } extraNode = document.createElement('div'); - extraNode.className = 'ant-click-animating-node'; + extraNode.className = `${prefixCls.value}-click-animating-node`; const attributeName = getAttributeName(); node.removeAttribute(attributeName); node.setAttribute(attributeName, 'true'); @@ -87,7 +87,7 @@ export default defineComponent({ } extraNode.style.borderColor = waveColor; styleForPesudo.innerHTML = ` - [ant-click-animating-without-extra-node='true']::after, .ant-click-animating-node { + [${prefixCls.value}-click-animating-without-extra-node='true']::after, .${prefixCls.value}-click-animating-node { --antd-wave-shadow-color: ${waveColor}; }`; if (!document.body.contains(styleForPesudo)) {