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,