From f9226cdfacd18787ecb835b540056b801be1e4c3 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Wed, 26 Aug 2020 13:21:41 +0800 Subject: [PATCH] perf(Button): move onClick fn --- src/button/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/button/index.js b/src/button/index.js index 622205d09..77f044258 100644 --- a/src/button/index.js +++ b/src/button/index.js @@ -116,6 +116,13 @@ export default createComponent({ } }; + const onClick = (event) => { + if (!props.loading && !props.disabled) { + emit('click', event); + route(); + } + }; + return () => { const { tag, @@ -131,13 +138,6 @@ export default createComponent({ nativeType, } = props; - const onClick = (event) => { - if (!loading && !disabled) { - emit('click', event); - route(); - } - }; - const classes = [ bem([ type,