index.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view>
  3. <home :cur="PageCur" v-if="PageCur == 'home'" :key="commponent1Key"></home>
  4. <history
  5. :cur="PageCur"
  6. v-if="PageCur == 'history'"
  7. :key="commponent2Key"
  8. ></history>
  9. <warndata
  10. :cur="PageCur"
  11. v-if="PageCur == 'warndata'"
  12. :key="commponent3Key"
  13. ></warndata>
  14. <operation v-if="PageCur == 'operation'" :key="commponent4Key"></operation>
  15. <filecenter
  16. :cur="PageCur"
  17. v-if="PageCur == 'filecenter'"
  18. :key="commponent5Key"
  19. ></filecenter>
  20. <u-tabbar
  21. :value="PageCur"
  22. @change="(name) => (PageCur = name)"
  23. :fixed="true"
  24. :placeholder="true"
  25. :safeAreaInsetBottom="true"
  26. >
  27. <u-tabbar-item
  28. text="设备监测"
  29. name="home"
  30. icon="list-dot"
  31. @click="NavChange('home')"
  32. ></u-tabbar-item>
  33. <u-tabbar-item
  34. text="历史数据"
  35. name="history"
  36. icon="calendar"
  37. @click="NavChange('history')"
  38. ></u-tabbar-item>
  39. <u-tabbar-item
  40. text="操作记录"
  41. icon="setting"
  42. name="operation"
  43. @click="NavChange('operation')"
  44. ></u-tabbar-item>
  45. <u-tabbar-item
  46. text="预警分析"
  47. icon="plus-circle"
  48. name="warndata"
  49. @click="NavChange('warndata')"
  50. ></u-tabbar-item>
  51. <u-tabbar-item
  52. text="文件中心"
  53. icon="file-text"
  54. name="filecenter"
  55. @click="NavChange('filecenter')"
  56. ></u-tabbar-item>
  57. </u-tabbar>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. PageCur: "home",
  65. commponent1Key: 0,
  66. commponent2Key: 1,
  67. commponent3Key: 2,
  68. commponent4Key: 3,
  69. commponent5Key: 4,
  70. };
  71. },
  72. onLoad: function () {
  73. this.PageCur = "home";
  74. },
  75. methods: {
  76. NavChange: function (e) {
  77. this.PageCur = e;
  78. },
  79. },
  80. };
  81. </script>
  82. <style>
  83. </style>