Skip to content

Commit 8ba7bdf

Browse files
XiaoHeituyuanwj
andauthored
fix(button): 为按钮添加type属性防止表单提交意外触发表单验证机制 (#6340)
在按钮组件中,按钮元素缺少type="button"属性可能导致在表单中意外提交。添加此属性以确保按钮行为符合预期。 Co-authored-by: yuanwj <[email protected]>
1 parent b015fbc commit 8ba7bdf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/@core/ui-kit/shadcn-ui/src/components/button/check-button-group.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ async function onBtnClick(value: ValueType) {
122122
v-bind="btnDefaultProps"
123123
:variant="innerValue.includes(btn.value) ? 'default' : 'outline'"
124124
@click="onBtnClick(btn.value)"
125+
type="button"
125126
>
126127
<div class="icon-wrapper" v-if="props.showIcon">
127128
<slot

0 commit comments

Comments
 (0)