iview If the [Bug Report] Select component sets the multiple property to true, setting an initial value to the V-model bound variable triggers the on-change event

lrl1mhuk  于 4个月前  发布在  其他
关注(0)|答案(2)|浏览(53)

Environment

macOs 10.12.6/Chrome 68.0.3440.106/Vue2.5.17

https://jsfiddle.net/pu5r870m/2/

Steps to reproduce

运行代码就好,查看控制台的输出

What is expected?

首次设置v-model绑定的值的时候,不要触发on-change事件

What is actually happening?

当设置Select组件为多选的时候,给v-model绑定的变量设置一个初始值时,on-change事件触发了

bbuxkriu

bbuxkriu1#

Translation of this issue:
Environment
MacOs 10.12.6/Chrome 68.0.3440.106/Vue2.5.17
Reproduction link
https://jsfiddle.net/pu5r870m/2/
Steps to reproduce
Run the code well, check the console output.
What is expected?
Do not trigger on-change events when setting the value of the V-model binding for the first time.
What is actually happening?
The on-change event triggers when the Select component is set to be multi-select and an initial value is set for the variable bound to the V-model

mctunoxg

mctunoxg2#

这个地方应该始终不等吧,虽然数组的值是相等的,但不是同一个数组,所以总会触发on-change事件

相关问题