Skip to content

Commit

Permalink
組件呼叫改狀態
Browse files Browse the repository at this point in the history
  • Loading branch information
malagege committed Jun 21, 2021
1 parent dcf52a7 commit a05d6cc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/components/Demo1.vue
@@ -0,0 +1,18 @@
<template>
Demo1
</template>
<script>
export default {
created(){
this.increment();
},
methods: {
increment() {
console.log('--- demo1 實作開始---')
this.$store.commit('increment')
console.log(this.$store.state.count)
console.log('--- demo1 實作結束---')
}
}
}
</script>
2 changes: 2 additions & 0 deletions src/components/HelloWorld.vue
Expand Up @@ -14,10 +14,12 @@
Edit
<code>components/HelloWorld.vue</code> to test hot module replacement.
</p>
<Demo1></Demo1>
</template>

<script setup>
import { defineProps, reactive } from 'vue'
import Demo1 from './Demo1.vue'
defineProps({
msg: String
Expand Down

0 comments on commit a05d6cc

Please sign in to comment.