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-03-events.../app.js

29 lines
664 B
JavaScript

const app = Vue.createApp({
data() {
return {
counter: 0,
name: "",
confirmedName: "",
};
},
methods: {
confirmName() {
this.confirmedName = this.name;
},
submitForm() {
alert("Submitted");
},
setName(event, lastName) {
this.name = event.target.value + " " + lastName;
},
increaseCounter(inputNumber) {
this.counter = this.counter + inputNumber;
},
decreaseCounter(inputNumber) {
this.counter = this.counter - inputNumber;
},
},
});
app.mount("#events");