fix: button wave error, close #6895

pull/6917/head
tangjinzhou 2023-08-30 16:05:54 +08:00
parent 1f01ae0728
commit 9855e43805
1 changed files with 3 additions and 4 deletions

View File

@ -41,21 +41,20 @@ export default defineComponent({
const node = findDOMNode(instance); const node = findDOMNode(instance);
node.removeEventListener('click', onClick, true); node.removeEventListener('click', onClick, true);
}; };
onMounted(() => { onMounted(() => {
watch( watch(
() => props.disabled, () => props.disabled,
() => { () => {
clear(); clear();
nextTick(() => { nextTick(() => {
const node = findDOMNode(instance); const node: HTMLElement = findDOMNode(instance);
node?.removeEventListener('click', onClick, true);
if (!node || node.nodeType !== 1 || props.disabled) { if (!node || node.nodeType !== 1 || props.disabled) {
return; return;
} }
// Click handler // Click handler
const onClick = (e: MouseEvent) => { onClick = (e: MouseEvent) => {
// Fix radio button click twice // Fix radio button click twice
if ( if (
(e.target as HTMLElement).tagName === 'INPUT' || (e.target as HTMLElement).tagName === 'INPUT' ||