mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 01:54:48 +00:00
perf(Button): move onClick fn
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user