编辑器:HBuilderX
data() {
return {
typeArr:[{name:'短信通知',value:'0'},
{name:'电话通知',value:'1'}],
typeArrIndex: 0
}
}
之后的方法中------------------------------------
console.log(this.typeArrIndex)
console.log(this.typeArrIndex == null)
console.log(this.typeArrIndex == 0)
console.log(this.typeArrIndex == '')
console.log(0 == '')
空值台的打印结果:
0
false
true
true
true