Mine.vue 978 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view>
  3. <modeBaseMine v-if="modeType == 'base'" ref="modeBaseMine"></modeBaseMine>
  4. <modeCareMine v-if="modeType == 'care'" ref="modeCareMine"></modeCareMine>
  5. </view>
  6. </template>
  7. <script>
  8. import modeBaseMine from '@/pages/BaseTabBar/Mine.vue'
  9. import modeCareMine from '@/pages/CareTabBar/Mine.vue'
  10. var that;
  11. export default {
  12. data() {
  13. return {
  14. modeType: ''
  15. }
  16. },
  17. components:{
  18. modeBaseMine,
  19. modeCareMine
  20. },
  21. onLoad(option) {
  22. that = this;
  23. that.modeType = uni.getStorageSync('modeType') || 'base';
  24. that.$nextTick(function() {
  25. if (that.modeType == 'base'){
  26. that.$refs.modeBaseMine.getData(option);
  27. }else if (that.modeType == 'care'){
  28. that.$refs.modeCareMine.getData(option);
  29. }
  30. })
  31. },
  32. onShow(){
  33. that.$nextTick(function() {
  34. if (that.modeType == 'base'){
  35. that.$refs.modeBaseMine.init();
  36. }else if (that.modeType == 'care'){
  37. that.$refs.modeCareMine.init();
  38. }
  39. })
  40. }
  41. }
  42. </script>