commit | author | age
|
38b8f3
|
1 |
Vue.createApp({ |
CM |
2 |
data() { |
|
3 |
return { |
|
4 |
goals: [], |
|
5 |
enteredValue: "", |
|
6 |
}; |
|
7 |
}, |
|
8 |
methods: { |
|
9 |
addGoal() { |
|
10 |
this.goals.push(this.enteredValue); |
|
11 |
this.enteredValue = ""; |
|
12 |
}, |
|
13 |
}, |
|
14 |
}).mount("#app"); |
|
15 |
|
|
16 |
// const buttonEl= document.querySelector('button'); |
|
17 |
// const inputEl= document.querySelector('input'); |
|
18 |
// const listEl = document.querySelector('ul'); |
|
19 |
|
|
20 |
// function addGoal(){ |
|
21 |
// const enteredValue = inputEl.value; |
|
22 |
// const listItemEl = document.createElement('li'); |
|
23 |
// listItemEl.textContent = enteredValue; |
|
24 |
// listEl.appendChild(listItemEl); |
|
25 |
// inputEl.value = ""; |
|
26 |
// } |
|
27 |
|
|
28 |
// buttonEl.addEventListener('click', addGoal); |