index.vue 624 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view class="index-page">
  3. <template v-if="isLogin">
  4. <index-logged />
  5. </template>
  6. <template v-else>
  7. <index-login />
  8. </template>
  9. </view>
  10. </template>
  11. <script>
  12. import IndexLogged from '../components/Index/Logged'
  13. import IndexLogin from '../components/Index/Login'
  14. export default {
  15. name: 'Index',
  16. components: { IndexLogged, IndexLogin },
  17. data() {
  18. return {
  19. isLogin: false,
  20. loading: true
  21. }
  22. },
  23. computed: {},
  24. methods: {
  25. },
  26. async onShow() {
  27. this.isLogin = this.$api.user.isLogin()
  28. }
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .index-page {
  33. }
  34. </style>