index.vue 933 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view class="">
  3. <Home v-if="index ===0"></Home>
  4. <myCase v-else-if="index === 1"></myCase>
  5. <navigationDynamic v-else-if="index === 2"></navigationDynamic>
  6. <personCenter v-else></personCenter>
  7. <Tab @toIndex="toIndex" :index="index"></Tab>
  8. </view>
  9. </template>
  10. <script>
  11. import Home from "../home/home.vue"
  12. import myCase from "../my-case/my-case.vue"
  13. import navigationDynamic from "../navigation-dynamic/navigation-dynamic.vue"
  14. import personCenter from "../person-center/person-center.vue"
  15. import Tab from "../../components/Tab/Tab.vue"
  16. import {
  17. newsBanner
  18. } from "../../api/news";
  19. export default {
  20. components: {
  21. Home,
  22. myCase,
  23. navigationDynamic,
  24. personCenter,
  25. },
  26. data() {
  27. return {
  28. index: 0,
  29. }
  30. },
  31. mounted() {
  32. },
  33. methods: {
  34. toIndex(index) {
  35. this.index = index
  36. // console.log("AAAAAAA", this.index)
  37. },
  38. },
  39. }
  40. </script>
  41. <style lang="scss" scoped></style>