## 獲取數據
一 訪問 statle數據
~~~
this.$store.state.數據明
~~~
第二種方式
~~~
<template>
<div>
<h1> 當前cont:{{ cont }}}</h1>
<button>+1</button>
</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'Add',
data () {
return {}
},
computed: {
...mapState(['cont'])
}
}
</script>
~~~