helpers.ts 628 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import Vue = require("vue");
  2. import {
  3. mapState,
  4. mapGetters,
  5. mapActions,
  6. mapMutations
  7. } from "../index";
  8. new Vue({
  9. computed: Object.assign({},
  10. mapState(["a"]),
  11. mapState({
  12. b: "b"
  13. }),
  14. mapState({
  15. c: (state: any, getters: any) => state.c + getters.c
  16. }),
  17. mapGetters(["d"]),
  18. mapGetters({
  19. e: "e"
  20. }),
  21. {
  22. otherComputed () {
  23. return "f";
  24. }
  25. }
  26. ),
  27. methods: Object.assign({},
  28. mapActions(["g"]),
  29. mapActions({
  30. h: "h"
  31. }),
  32. mapMutations(["i"]),
  33. mapMutations({
  34. j: "j"
  35. }),
  36. {
  37. otherMethod () {}
  38. }
  39. )
  40. });