Watch: { // tel is data () data inside tel, newVal tel is a value of change, oldVal the value before the change tel tel (newVal, oldVal) { the console.log (newVal, oldVal) IF (newVal =! "" ) { the this .isDisabled = to false } the else { the this .isDisabled = to true } } },
Watch: { // tel is data () data inside tel, newVal tel is a value of change, oldVal the value before the change tel tel: { Handler (newVal, oldVal) { the console.log (newVal, oldVal) IF ( = newVal "") {! this.isDisabled to false = } {the else this.isDisabled = to true } }, // deep depth attribute objects listener deep: true, there is a characteristic // when so used watch, that is, when the value of when once bound, the listener does not perform a function, only the value changes will be performed. // If we need to also perform the function when the first binding value, you need to use immediate property. When traditional values such as when a parent component to child component dynamic, sub-assemblies props for the first time to get the default value of the parent assembly came also need to perform a function, then you need the immediate set to true. immediate: to true } },