From 2a10372d066e350fc569b5595ec64667d915abc9 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Mon, 14 Feb 2022 18:26:40 +0800 Subject: [PATCH] fix(nvue): button --- packages/uni-components/dist/components.js | 4 ++-- packages/uni-components/src/nvue/button/index.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/uni-components/dist/components.js b/packages/uni-components/dist/components.js index e0f4440c2..12d854e15 100644 --- a/packages/uni-components/dist/components.js +++ b/packages/uni-components/dist/components.js @@ -478,7 +478,7 @@ var Button = defineComponent({ return; } if (isLabelClick) { - rootRef.value.click(); + rootRef.value.event.click.handler(); } }; const _getClass = (t2) => { @@ -518,7 +518,7 @@ var Button = defineComponent({ return vnodes; }; return () => { - return createVNode("div", mergeProps({ + return createVNode("view", mergeProps({ "ref": rootRef, "class": ["ub", _getClass("")] }, extend({}, useHoverClass(props), { diff --git a/packages/uni-components/src/nvue/button/index.tsx b/packages/uni-components/src/nvue/button/index.tsx index ecfca1219..a0e199427 100644 --- a/packages/uni-components/src/nvue/button/index.tsx +++ b/packages/uni-components/src/nvue/button/index.tsx @@ -211,7 +211,7 @@ export default defineComponent({ return } if (isLabelClick) { - rootRef.value!.click() + ;(rootRef.value as any).event.click.handler(e) } /* const formType = props.formType if (formType) { @@ -269,7 +269,7 @@ export default defineComponent({ return () => { return ( -
) : null} {...wrapSlots()} -
+ ) } }, -- GitLab