We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eceda80 commit f748e6cCopy full SHA for f748e6c
4-state-management/4.3-shared-instance-store.html
@@ -1,6 +1,6 @@
1
<script src="../node_modules/vue/dist/vue.js"></script>
2
3
-<div>
+<div id="app">
4
<counter></counter>
5
6
@@ -11,15 +11,29 @@
11
// copy and modify the first exercise to use a Vue instance as
12
// a shared store instead.
13
const state = new Vue({
14
- // Implement this!
+ data: {
15
+ count: 0
16
+ },
17
+ methods: {
18
+ inc () {
19
+ this.count++
20
+ }
21
22
})
23
24
const Counter = {
25
+ render: h => h('div', state.count)
26
}
27
28
new Vue({
29
el: '#app',
30
+ components: {
31
+ Counter
32
33
34
35
+ state.inc()
36
37
38
39
</script>
0 commit comments