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/basics-assignment-3-problem/app.js

35 lines
647 B
JavaScript

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