Skip to content

Commit

Permalink
mapState 1
Browse files Browse the repository at this point in the history
  • Loading branch information
malagege committed Jun 22, 2021
1 parent a05d6cc commit 4e9b200
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Demo1.vue
@@ -1,7 +1,10 @@
<template>
Demo1
Demo1<br>
{{ count }}
</template>
<script>
import { mapState } from 'vuex'
export default {
created(){
this.increment();
Expand All @@ -13,6 +16,7 @@ export default {
console.log(this.$store.state.count)
console.log('--- demo1 實作結束---')
}
}
},
computed:mapState(['count'])
}
</script>

0 comments on commit 4e9b200

Please sign in to comment.