1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| const app = Vue.createApp({
| data() {
| return {
| counter: 0,
| name: ''
| };
| },
| methods: {
| setName(event, lastName) {
| this.name = event.target.value + ' ' + lastName;
| },
| add(num) {
| this.counter = this.counter + num;
| },
| reduce(num) {
| this.counter = this.counter - num;
| // this.counter--;
| }
| }
| });
|
| app.mount('#events');
|
|