Skip to content

Commit

Permalink
Merge pull request #119 from AnsGoo/dev
Browse files Browse the repository at this point in the history
解决Button组件没有指定type导致第一次点击会刷新页面BUG
  • Loading branch information
AnsGoo authored Mar 24, 2024
2 parents 2ea4bf3 + 4c4d4f5 commit f2411da
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ui/Button/Button.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<button v-bind="$attrs" :class="classStyle" :style="{ width: btnWidth }" @click="handleClick">
<button
v-bind="$attrs"
type="button"
:class="classStyle"
:style="{ width: btnWidth }"
@click.prevent="handleClick"
>
<slot name="icon"></slot>
<slot></slot>
</button>
Expand Down

0 comments on commit f2411da

Please sign in to comment.