26 lines
511 B
JavaScript
26 lines
511 B
JavaScript
const app = Vue.createApp({
|
|
data() {
|
|
return {
|
|
counter: 0,
|
|
name: "",
|
|
};
|
|
},
|
|
methods: {
|
|
setName(event, lastName) {
|
|
this.name = event.target.value;
|
|
},
|
|
add(num) {
|
|
this.counter = this.counter + num;
|
|
},
|
|
reduce(num) {
|
|
this.counter = this.counter - num;
|
|
// this.counter--;
|
|
},
|
|
resetInput() {
|
|
this.name = "";
|
|
},
|
|
},
|
|
});
|
|
|
|
app.mount("#events");
|