Counter.vue 583 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 './store/actions'
  15. import { recentHistory } from './store/getters'
  16. export default {
  17. vuex: {
  18. state: {
  19. count: state => state.count,
  20. recentHistory
  21. },
  22. actions: actions
  23. }
  24. }
  25. </script>