Blame view

node_modules/mpvue-zanui/src/pages/counter/index.vue 750 Bytes
ce4c83ff   wxy   初始提交
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
35
36
37
38
39
40
41
42
43
44
45
46
47
  <template>
    <div class="counter-warp">
      <p>Vuex counter:{{ count }}</p>
      <p>
        <button @click="increment">+</button>
        <button @click="decrement">-</button>
      </p>
  
      <a href="/pages/index/index" class="home">去往首页</a>
    </div>
  </template>
  
  <script>
  // Use Vuex
  import store from './store'
  
  export default {
    computed: {
      count () {
        return store.state.count
      }
    },
    methods: {
      increment () {
        store.commit('increment')
      },
      decrement () {
        store.commit('decrement')
      }
    }
  }
  
  </script>
  <style>
  .counter-warp {
    text-align: center;
    margin-top: 100px;
  }
  .home {
    display: inline-block;
    margin: 100px auto;
    padding: 5px 10px;
    color: blue;
    border: 1px solid blue;
  }
  
  </style>