1
0

Counter.vue 574 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <div>
  3. Value: {{ count }}
  4. <button @click="increment">+</button>
  5. <button @click="decrement">-</button>
  6. <button @click="incrementIfOdd">Increment if odd</button>
  7. <button @click="incrementAsync">Increment async</button>
  8. <div>
  9. <div>Recent History: {{recentHistory}}</div>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. import * as actions from './vuex/actions'
  15. import { recentHistory } from './vuex/getters'
  16. export default {
  17. vuex: {
  18. actions,
  19. getters: {
  20. count: state => state.count,
  21. recentHistory
  22. }
  23. }
  24. }
  25. </script>