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 |
}, |
3194f7
|
18 |
beforeCreate(){ |
CM |
19 |
console.log("beforeCreate()"); |
|
20 |
}, |
|
21 |
created(){ |
|
22 |
console.log("create()"); |
|
23 |
}, |
|
24 |
beforeMount(){ |
|
25 |
console.log("beforeMount()"); |
|
26 |
}, |
|
27 |
mounted(){ |
|
28 |
console.log("mounted()"); |
|
29 |
}, |
|
30 |
beforeUpdate(){ |
|
31 |
console.log("beforeUpdate()"); |
|
32 |
}, |
|
33 |
updated(){ |
|
34 |
console.log("updated()"); |
|
35 |
}, |
|
36 |
beforeUnmount(){ |
|
37 |
console.log("beforeUnmount()"); |
|
38 |
}, |
|
39 |
unmounted(){ |
|
40 |
console.log("upmounted()"); |
|
41 |
} |
2b50a7
|
42 |
}); |
CM |
43 |
|
30fe86
|
44 |
app.mount("#app"); |
2b50a7
|
45 |
|
CM |
46 |
const app2 = Vue.createApp({ |
|
47 |
data() { |
|
48 |
return { |
30fe86
|
49 |
favoriteMeal: "pizza!!", |
2b50a7
|
50 |
}; |
CM |
51 |
}, |
|
52 |
computed: {}, |
|
53 |
watch: {}, |
|
54 |
methods: {}, |
30fe86
|
55 |
template: ` |
CM |
56 |
<p>{{ favoriteMeal }}</p> |
|
57 |
`, |
2b50a7
|
58 |
}); |
CM |
59 |
|
30fe86
|
60 |
app2.mount("#app2"); |