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

29 lines
646 B
JavaScript
Raw Normal View History

2021-01-18 23:22:34 +01:00
"use strict";
const app = Vue.createApp({
data() {
return {
2021-01-18 23:34:24 +01:00
inputClass: "",
2021-01-18 23:22:34 +01:00
paragraphVisible: true,
inputColor: "",
};
},
computed: {
classFromUserInput() {
return {
user1: this.inputClass === "user1",
user2: this.inputClass === "user2",
2021-01-18 23:22:34 +01:00
visible: this.paragraphVisible,
hidden: !this.paragraphVisible,
2021-01-18 23:22:34 +01:00
};
},
},
methods: {
toggleParagraphVisibility() {
this.paragraphVisible = !this.paragraphVisible;
},
},
});
app.mount("#assignment");