Compare commits

..

2 Commits

Author SHA1 Message Date
neverland
b98b6024c8
docs(Popover): add fastclick faq 2021-05-21 18:05:14 +08:00
neverland
9d28b276f1
fix(Button): should not submit form when loading (#8735) 2021-05-21 16:04:44 +08:00
2 changed files with 9 additions and 0 deletions

View File

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

View File

@ -259,3 +259,9 @@ export default {
| @popover-dark-text-color | `@white` | - | | @popover-dark-text-color | `@white` | - |
| @popover-dark-background-color | `#4a4a4a` | - | | @popover-dark-background-color | `#4a4a4a` | - |
| @popover-dark-action-disabled-text-color | `@gray-6` | - | | @popover-dark-action-disabled-text-color | `@gray-6` | - |
## 常见问题
### Popover 的点击事件无法正确触发?
这种情况通常是由于项目中引入了 `fastclick` 库导致的。建议移除 `fastclick`,或者配置 `fastclick` 的 [ignore 规则](https://github.com/ftlabs/fastclick#advanced)。