This repository has been archived on 2021-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
vuejs_course/2021-01-18 basics-assignmen.../app.js

36 lines
728 B
JavaScript

"use strict";
const app = Vue.createApp({
data() {
return {
counter: 0,
};
},
watch: {
status() {
const that = this;
setTimeout(function () {
that.counter = 0;
}, 5000);
},
},
computed: {
status() {
if (this.counter < 37) {
return "Not there yet";
} else if (this.counter > 37) {
return "Too much!";
} else if (this.counter === 37) {
return this.counter;
}
},
},
methods: {
increaseCounter(value) {
this.counter += value;
},
},
});
app.mount("#assignment");