add a real example for watchers
This commit is contained in:
parent
b64a3bd35e
commit
bc69656d06
|
@ -7,22 +7,16 @@ const app = Vue.createApp({
|
||||||
// fullName: "",
|
// fullName: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// watch: {
|
watch: {
|
||||||
// name(value) {
|
counter(value) {
|
||||||
// if (value === "") {
|
if (value > 50) {
|
||||||
// this.fullName = "";
|
const that = this;
|
||||||
// } else {
|
setTimeout(function () {
|
||||||
// this.fullName = value + " " + this.lastName;
|
that.counter = 0;
|
||||||
// }
|
}, 2000);
|
||||||
// },
|
}
|
||||||
// lastName(value) {
|
},
|
||||||
// if (value === "") {
|
},
|
||||||
// this.fullName = "";
|
|
||||||
// } else {
|
|
||||||
// this.fullName = this.name + " " + value;
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
computed: {
|
computed: {
|
||||||
fullName() {
|
fullName() {
|
||||||
if (this.name === "" || this.lastName === "") {
|
if (this.name === "" || this.lastName === "") {
|
||||||
|
|
Reference in New Issue