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 () => {
|
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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user