mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +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 () => {
|
return () => {
|
||||||
const {
|
const {
|
||||||
tag,
|
tag,
|
||||||
@@ -131,13 +138,6 @@ export default createComponent({
|
|||||||
nativeType,
|
nativeType,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const onClick = (event) => {
|
|
||||||
if (!loading && !disabled) {
|
|
||||||
emit('click', event);
|
|
||||||
route();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const classes = [
|
const classes = [
|
||||||
bem([
|
bem([
|
||||||
type,
|
type,
|
||||||
|
Reference in New Issue
Block a user