commit | author | age
|
2b50a7
|
1 |
const app = Vue.createApp({ |
CM |
2 |
data() { |
|
3 |
return { |
30fe86
|
4 |
currentUserInput: "", |
CM |
5 |
message: "Vue is great!", |
2b50a7
|
6 |
}; |
CM |
7 |
}, |
|
8 |
methods: { |
|
9 |
saveInput(event) { |
|
10 |
this.currentUserInput = event.target.value; |
|
11 |
}, |
|
12 |
setText() { |
a3f456
|
13 |
// this.message = this.currentUserInput; |
CM |
14 |
this.message = this.$refs.userText.value; |
|
15 |
// console.dir(this.$refs.userText) |
2b50a7
|
16 |
}, |
CM |
17 |
}, |
|
18 |
}); |
|
19 |
|
30fe86
|
20 |
app.mount("#app"); |
2b50a7
|
21 |
|
CM |
22 |
const app2 = Vue.createApp({ |
|
23 |
data() { |
|
24 |
return { |
30fe86
|
25 |
favoriteMeal: "pizza!!", |
2b50a7
|
26 |
}; |
CM |
27 |
}, |
|
28 |
computed: {}, |
|
29 |
watch: {}, |
|
30 |
methods: {}, |
30fe86
|
31 |
template: ` |
CM |
32 |
<p>{{ favoriteMeal }}</p> |
|
33 |
`, |
2b50a7
|
34 |
}); |
CM |
35 |
|
30fe86
|
36 |
app2.mount("#app2"); |