climblee/uv-ui

uv-switch组件如何阻止之间冒泡呢?

Opened this issue · 0 comments

现在给父元素添加了点击事件,然后点击开关的时候同时会触发父元素的点击事件。给父元素点击事件添加.stop后,又无法触发父元素的点击事件
代码如下

<uv-form-item :class="caseForm.activeProps.includes('treatmentNoResponse') ? 'active' : ''" label="治疗无效"
                prop="treatmentNoResponse" @click.stop.prevent="select('treatmentNoResponse')">
        <uv-switch v-model="caseForm.treatmentNoResponse" :activeValue="1" :inactiveValue="0"
                inactive-color="#f3f4f6" active-color="#3c9cff"></uv-switch>
</uv-form-item>