1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| <script >
| import {store} from '../utils/status.js'
| import {useCount} from '../utils/status1.js'
| export default {
| data() {
| return{
| store,
|
| localCount:0
| }
| },
| mounted(){
| this.localCount = useCount()
| },
| methods: {
|
| }
| }
| </script>
|
| <template>
| <div>
| <el-button @click="store.increment()">增加</el-button>
| <div>count:{{ store.count }}</div>
|
| <!-- <div>{{ globalCount.value }}</div> -->
| <div>{{ localCount.localCount }}</div>
|
| </div>
| </template>
|
| <style lang="scss" scoped>
|
| </style>
|
|