UserBlock.vue 478 B

12345678910111213141516171819202122232425262728293031
  1. <template lang="html">
  2. <UserTools v-if="token" />
  3. <Login v-else />
  4. </template>
  5. <script>
  6. import { mapState, mapActions } from 'vuex'
  7. import Login from 'vuejs/components/User/Login'
  8. import UserTools from 'vuejs/components/User/UserTools'
  9. export default {
  10. // data () {
  11. // return {}
  12. // },
  13. computed: {
  14. ...mapState({
  15. token: state => state.User.token
  16. })
  17. },
  18. components: {
  19. Login,
  20. UserTools
  21. }
  22. }
  23. </script>
  24. <style lang="css" scoped>
  25. </style>