my.vue 447 B

1234567891011121314151617181920212223242526
  1. <template>
  2. <view>
  3. <!-- 用户未登录时,显示登录组件 -->
  4. <my-login v-if="!token && token === ''"></my-login>
  5. <!-- 用户登录后,显示用户信息组件 -->
  6. <my-userinfo v-else></my-userinfo>
  7. </view>
  8. </template>
  9. <script>
  10. import { mapState, mapMutations } from 'vuex'
  11. export default {
  12. computed: {
  13. ...mapState('m_user', ['token'])
  14. },
  15. data() {
  16. return {
  17. };
  18. }
  19. }
  20. </script>
  21. <style lang="scss">
  22. </style>