index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="layout">
  3. <Navbar></Navbar>
  4. <view class="appMain">
  5. <!-- <template v-if="routName.pathName"></template> -->
  6. <index v-if="routName=='首页'"></index>
  7. <powerchange v-if="routName=='换电监控'"></powerchange>
  8. <equipment v-if="routName=='设备监控'"></equipment>
  9. <service v-if="routName=='服务记录'"></service>
  10. <alarm v-if="routName=='故障告警'"></alarm>
  11. <basic v-if="routName=='基础数据'"></basic>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import powerchange from '@/pages/power-changer/index'
  17. import equipment from '@/pages/equipment-monitoring/index'
  18. import service from '@/pages/service-recode/index'
  19. import alarm from '@/pages/fault-alarm/index'
  20. import basic from '@/pages/basic-data/index'
  21. import index from '@/pages/index/index'
  22. export default {
  23. components:{
  24. index,powerchange,equipment,service,alarm,basic
  25. },
  26. data() {
  27. return {
  28. }
  29. },
  30. onShow(){
  31. },
  32. computed:{
  33. routName(){
  34. return this.$store.state.currentpage
  35. }
  36. },
  37. onLoad() {
  38. // console.log(this.$store.state)
  39. this.$store.commit("UPDATEPAGE",'首页')
  40. this.$storage.setJson("pageName",'首页')
  41. },
  42. methods: {
  43. }
  44. }
  45. </script>
  46. <style lang="scss" scoped>
  47. .layout{
  48. display: flex;
  49. width: 100%;
  50. padding:0px 20px;
  51. box-sizing: border-box;
  52. justify-content: space-between;
  53. .appMain{
  54. flex: 1;
  55. height: 100vh;
  56. padding: 20px;
  57. padding-right: 0px;
  58. box-sizing: border-box;
  59. }
  60. }
  61. </style>