You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
element-bot
changed the title
[Bug Report] el-switch的v-model传入int类型时判断有误
[Bug Report] el-switch's V-model is incorrect when it is introduced into int type.
Jun 21, 2018
That is, the overall modification is
Var Main = {{
Data () {
Return {
Value5:'100'
}
},
Mounted () {
Let Val = 100;
This.value5 = Val;
}
};
Var Ctor = Vue.extend (Main)
New Ctor ().$mount ('#app')
click on the upper left corner to find the right switch button to close.
let Val = 100; change to let Val = '100';
click on the upper left corner to find the right switch button to open.
What is Expected?
Whether the value of V-model is'100'or 100, if the value is equal to el-switch active-value, the switch button is opened.
What is actually happening?
In the HTML code of the upper left column, the active-value attribute of the el-switch tag is active-value= "100" or active-value=100, and when value5 is'100'(string), it is closed when value5 is 100 (int).
Therefore, it should be wrong when the value of V-model is int.
Element UI version
2.4.1
OS/Browsers version
win10 / Chrome 66.0.3359.117
Vue version
2.5.16
Reproduction Link
https://jsfiddle.net/esn7rfo3/3/
Steps to reproduce
1.将左下栏目的js代码增加
mounted() {
let val = 100;
this.value5 = val;
}
即,整体修改为
var Main = {
data() {
return {
value5: '100'
}
},
mounted() {
let val = 100;
this.value5 = val;
}
};
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')
2.点击左上角运行,发现右侧switch按钮为关闭
3.将 let val = 100; 改为 let val = ‘100’;
4.点击左上角运行,发现右侧switch按钮为开启
What is Expected?
无论v-model的值为 '100' 或 100 ,只要值等于el-switch的active-value,switch按钮为开启
What is actually happening?
左上栏目的html代码中,无论el-switch标签的active-value属性为 active-value="100" 或 active-value=100 ,当value5为 '100'(string) 时皆为开启,当value5 为 100(int) 时皆为关闭。
故,应是对v-model的值为int时判断有误吧
The text was updated successfully, but these errors were encountered: