index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view>
  3. <home :cur="PageCur" v-if="PageCur=='home'" :key="commponent1Key"></home>
  4. <history :cur="PageCur" v-if="PageCur=='history'" :key="commponent2Key"></history>
  5. <warndata :cur="PageCur" v-if="PageCur=='warndata'" :key="commponent3Key"></warndata>
  6. <people v-if="PageCur=='people'" :key="commponent4Key"></people>
  7. <camera :cur="PageCur" v-if="PageCur=='camera'" :key="commponent5Key"></camera>
  8. <view class="cu-bar tabbar bg-white shadow foot">
  9. <view :class="PageCur=='home'?'action text-green':'action text-gray'" @click="NavChange" data-cur="home">
  10. <view class='cuIcon-homefill'></view>设备监测
  11. </view>
  12. <view :class="PageCur=='history'?'action text-green':'action text-gray'" @click="NavChange" data-cur="history">
  13. <view class='cuIcon-peoplelist'></view>历史数据
  14. </view>
  15. <view :class="PageCur=='warndata'?'action text-green':'action text-gray'" @click="NavChange" data-cur="warndata">
  16. <view class='cuIcon-profile'></view>预警分析
  17. </view>
  18. <view :class="PageCur=='people'?'action text-green':'action text-gray'" @click="NavChange" data-cur="people">
  19. <view class='cuIcon-people'></view>操作记录
  20. </view>
  21. <view :class="PageCur=='camera'?'action text-green':'action text-gray'" @click="NavChange" data-cur="camera">
  22. <view class='cuIcon-camera'></view>视频监测
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. PageCur: 'home',
  32. commponent1Key: 0,
  33. commponent2Key: 1,
  34. commponent3Key: 2,
  35. commponent4Key: 3,
  36. commponent5Key: 4,
  37. }
  38. },
  39. onLoad:function(){
  40. this.PageCur='home'
  41. ++this.commponent1Key
  42. ++this.commponent2Key
  43. ++this.commponent3Key
  44. ++this.commponent4Key
  45. ++this.commponent5Key
  46. },
  47. methods: {
  48. NavChange: function(e) {
  49. this.PageCur = e.currentTarget.dataset.cur
  50. }
  51. }
  52. }
  53. </script>
  54. <style>
  55. </style>