Skip to content

Commit

Permalink
fix: 禁止了 f-form 组件的原生表单校验
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Jun 19, 2024
1 parent 996c2b9 commit d290b35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- 修复 `f-select` 组件 `filter` 配置项筛选点击闪烁的问题
- 修复 `f-checkbox-group` 组件 `row-gap` 配置项失效问题
- 禁止了 `f-form` 组件的原生表单校验

## 1.0.0-alpha.8 (2024-06-12)

Expand Down
9 changes: 7 additions & 2 deletions packages/fighting-design/form/src/form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
const submit = (evt: SubmitEvent): void => {
/**
* 组织表单默认行为
* 阻止表单默认行为
*
* @see event.preventDefault https://developer.mozilla.org/zh-CN/docs/Web/API/Event/preventDefault
*/
Expand All @@ -45,7 +45,12 @@
</script>

<template>
<form v-if="$slots.default" role="form" class="f-form" :onsubmit="submit">
<!--
novalidate:禁止原生提交时的表单校验和弹窗
https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/form#novalidate
-->
<form v-if="$slots.default" role="form" class="f-form" novalidate :onsubmit="submit">
<slot />
</form>
</template>

0 comments on commit d290b35

Please sign in to comment.