用watch方法监听当前自己设置的值
watch: {
searchName(nVal) {
this.$emit('input',nVal);
this.$emit('change',nVal);
},
value:{
immediate:true,
handler(nVal) {
this.searchName = nVal;
}
watch: {
searchName(nVal) {
this.$emit('input',nVal);
this.$emit('change',nVal);
},
value:{
immediate:true,
handler(nVal) {
this.searchName = nVal;
}