Skip to content

Commit 756e19f

Browse files
committed
fix: 更新点击事件处理,避免对子项的点击响应
1 parent a8e73be commit 756e19f

File tree

1 file changed

+5
-1
lines changed
  • packages/element-x-ui/src/components/Prompts

1 file changed

+5
-1
lines changed

packages/element-x-ui/src/components/Prompts/main.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
class="el-x-prompts-nested"
8080
:items="info.children"
8181
:vertical="true"
82-
:on-item-click="onItemClick"
82+
@on-item-click="$emit('on-item-click', $event)"
8383
:class-names="{
8484
list: classNames.subList,
8585
item: classNames.subItem
@@ -216,6 +216,10 @@ export default {
216216
if (info.disabled) {
217217
return;
218218
}
219+
// 如果有子项,不触发点击事件
220+
if (this.hasChildren(info)) {
221+
return;
222+
}
219223
this.$emit('on-item-click', { data: info });
220224
// 向后兼容性
221225
if (this.onItemClick) {

0 commit comments

Comments
 (0)