mine.vue 991 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!-- 我的 -->
  2. <template>
  3. <view id="mine">
  4. <teacher-mine class="flex-box-page" ref="teacherMine" v-if="userType==1"></teacher-mine>
  5. <pupil-mine class="flex-box-page" ref="pupilMine" v-if="userType==2"></pupil-mine>
  6. </view>
  7. </template>
  8. <script>
  9. import teacherMine from '@/pages/views/teacherPage/teacherMine'
  10. import pupilMine from '@/pages/views/pupilPage/pupilMine'
  11. export default {
  12. components: {
  13. teacherMine,
  14. pupilMine,
  15. },
  16. data() {
  17. return {
  18. userType: 0,
  19. }
  20. },
  21. onLoad() {
  22. },
  23. onShow() {
  24. this.userType = uni.getStorageSync('userType')
  25. this.$nextTick(()=>{
  26. if(this.userType == 1){
  27. this.$refs.teacherMine.initialize();
  28. }else if(this.userType == 2){
  29. this.$refs.pupilMine.initialize();
  30. }
  31. })
  32. },
  33. methods: {
  34. },
  35. }
  36. </script>
  37. <style lang="stylus" scoped>
  38. #mine {
  39. height: 100%;
  40. display: flex;
  41. flex-direction: column;
  42. .flex-box-page{
  43. flex:1;
  44. display: flex;
  45. flex-direction: column;
  46. }
  47. }
  48. </style>