fix(Button): should not submit form when loading (#8735)

This commit is contained in:
neverland 2021-05-21 16:04:44 +08:00 committed by GitHub
parent a393114118
commit 9d28b276f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,9 @@ function Button(
}
function onClick(event: Event) {
if (props.loading) {
event.preventDefault();
}
if (!loading && !disabled) {
emit(ctx, 'click', event);
functionalRoute(ctx);