App.vue 547B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <div id="app">
  3. <router-view/>
  4. </div>
  5. </template>
  6. <script>
  7. import { createNamespacedHelpers } from 'vuex'
  8. const { mapState: mapIndexState, mapActions: mapIndexActions } = createNamespacedHelpers('main')
  9. export default {
  10. data () {
  11. return {}
  12. },
  13. computed:{
  14. ...mapIndexState({
  15. userInfo: item => item.userInfo
  16. })
  17. },
  18. methods:{
  19. ...mapIndexActions(['setUserInfo'])
  20. }
  21. }
  22. </script>
  23. <style lang="scss">
  24. @import "./assets/reset.css";
  25. #app {
  26. width: 100%;
  27. height: 100%;
  28. position: relative;
  29. }
  30. </style>