由于是解决为空,如何传值请自行百度
利用watch:{}来监听父级传值的变化,如果父级传的值发生了改变就调用回调函数function重新赋值
watch: {
countrydata: function(newVal) {
//console.log(newVal, 'CCCCCCC')
var reg = /(^[\-0-9][0-9]*(.[0-9]+)?)$/
if (reg.test(newVal)) {
this.selectValue = newVal //新的值赋值到data中
return
}
this.selectValue = ''
}
},