Iview: Switch 无法阻止改变

Created on 18 May 2017  ·  1Comment  ·  Source: iview/iview



iView 版本号

2.0.0-rc.9

操作系统/浏览器 版本号

macOS/Chrome 57

Vue 版本号

2.2.2

示例代码

 <i-switch v-model="switch1" @on-change="change"></i-switch>

问题现象,以及你期望的结果是怎样的?

现象 : 我希望在点击时会弹出Confirm,让用户确认是否切换,但用户还没选择,组件的状态已经改变。

期望 : 可以中断状态改变

可能的原因 : on-change事件应该在状态改变之前触发,如果返回值为false,则应跳过

Most helpful comment

899

>All comments

899

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kengqiangxia picture kengqiangxia  ·  3Comments

chenhaizano picture chenhaizano  ·  3Comments

ai116458960 picture ai116458960  ·  3Comments

sunyifeng520 picture sunyifeng520  ·  3Comments

lvqingan picture lvqingan  ·  3Comments