mine.vue 1001 B

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