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

36 lines
721 B
JavaScript
Raw Normal View History

2021-01-18 22:12:11 +01:00
"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";
} else if (this.result > 37) {
2021-01-18 22:12:11 +01:00
return "Too much!";
} else if (this.result === 37) {
return this.result;
2021-01-18 22:12:11 +01:00
}
},
},
methods: {
increaseCounter(value) {
this.result += value;
},
},
});
app.mount("#assignment");