Environment
win10/chrome60/vue2.5
Reproduction link
https://run.iviewui.com/WTs4bGkY
Steps to reproduce
select 使用 “:value=0”给组件赋值,下拉选项选中1,触发on-change,下拉选项选回0,没有触发,若是使用 v-model 则可以正常触发。
测试发现,只要是:value赋予的初始值就无法监听变化,使用v-model绑定则正常触发。
What is expected?
select 使用 “:value=0”给组件赋值,下拉选项选中1,触发on-change,下拉选项选回0,正常触发
What is actually happening?
select 使用 “:value=0”给组件赋值,下拉选项选中1,触发on-change,下拉选项选回0,没有触发
测试发现,只要是:value赋予的初始值就无法监听变化,使用v-model绑定则正常触发。
1条答案
按热度按时间7kjnsjlb1#
Translation of this issue:
Environment
Win10/chrome60/vue2.5
Reproduction link
https://run.iviewui.com/WTs4bGkY
Steps to reproduce
Select uses ": value = 0" to assign values to components, dropdown option 1 is selected, on-change is triggered, drop-down option 0 is selected, no trigger is triggered, if you use V-model you can trigger normally.
The test found that as long as the initial value given by the value was not able to listen for changes, the use of V-model bindings triggered normally.
What is expected?
Select uses ": value = 0" to assign values to components, select 1 for the drop-down option, trigger on-change, select 0 for the drop-down option, and trigger normally
What is actually happening?
Select uses ": value = 0" to assign values to components, select 1 for the drop-down option, trigger on-change, and select 0 for the drop-down option, without triggering
The test found that as long as the initial value given by the value was not able to listen for changes, the use of V-model bindings triggered normally.