Skip to content

Commit 4c22cf5

Browse files
feat: ✨ 阻止tag的关闭和新增事件冒泡
1 parent 82d8e49 commit 4c22cf5

File tree

1 file changed

+6
-6
lines changed
  • src/uni_modules/wot-design-uni/components/wd-tag

1 file changed

+6
-6
lines changed

src/uni_modules/wot-design-uni/components/wd-tag/wd-tag.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<view class="wd-tag__text" :style="textStyle">
88
<slot />
99
</view>
10-
<wd-icon v-if="closable && round" custom-class="wd-tag__close" name="error-fill" @click="handleClose" />
10+
<wd-icon v-if="closable && round" custom-class="wd-tag__close" name="error-fill" @click.stop="handleClose" />
1111
<input
1212
v-if="dynamicInput && dynamic"
1313
class="wd-tag__add-text"
@@ -18,7 +18,7 @@
1818
@blur="handleBlur"
1919
@confirm="handleConfirm"
2020
/>
21-
<view v-else-if="dynamic" class="wd-tag__text" :style="textStyle" @click="handleAdd">
21+
<view v-else-if="dynamic" class="wd-tag__text" :style="textStyle" @click.stop="handleAdd">
2222
<slot name="add" v-if="$slots.add"></slot>
2323
<template v-else>
2424
<wd-icon name="add" custom-class="wd-tag__add wd-tag__icon" />
@@ -117,11 +117,11 @@ function computeTagClass() {
117117
tagClass.value = tagClassList.join(' ')
118118
}
119119
120-
function handleClick() {
121-
emit('click')
120+
function handleClick(event: any) {
121+
emit('click', event)
122122
}
123-
function handleClose() {
124-
emit('close')
123+
function handleClose(event: any) {
124+
emit('close', event)
125125
}
126126
function handleAdd() {
127127
dynamicInput.value = true

0 commit comments

Comments
 (0)