mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-24 15:39:15 +08:00
perf(Button): move onClick fn
This commit is contained in:
parent
e2e34fd26e
commit
f9226cdfac
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user