ElemeFE / ElemeFE/mint-ui

[Bug Report] mt-cell嵌套mt-switch,switch点击会先调用cell的click事件

Open
#1,594 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
16.4k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

### Mint UI version
2.2.13

### OS/Browsers version
chrom最新版

### Vue version
2.6.10

### Reproduction Link
https://codepen.io/banjiemin/pen/oNvWREZ

### Steps to reproduce
1,mt-cell mt-button, 点击button执行func(0), 点击cell执行 func(2) ,这里很正常;
2,mt-cell mt-switch, 点击switch执行func(2) 两次,再执行func(0),
点击cell执行 func(2);

### What is Expected?
子组件mt-switch能阻止事件冒泡到父组件上

### What is actually happening?
先执行了父组件的click事件,并且是两次,然后才执行switch的change事件 。

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reproduction link and inspect the mt-cell and mt-switch components under Vue 2.6.10 and Mint UI 2.2.13. Reproduce the event sequence in Chrome, then verify that clicking mt-switch no longer triggers the parent cell click while the switch change event still fires and direct cell clicks retain their behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.