index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view>
  3. <home :cur="PageCur" v-if="PageCur=='home'" :key="commponent1Key"></home>
  4. <people v-if="PageCur=='people'" :key="commponent2Key"></people>
  5. <view class="cu-bar tabbar bg-white shadow foot">
  6. <view :class="PageCur=='home'?'action text-green':'action text-gray'" @click="NavChange" data-cur="home">
  7. <view class='cuIcon-homefill'></view>主页
  8. </view>
  9. <!-- <view :class="PageCur=='peoplelis'?'action text-green':'action text-gray'" @click="NavChange" data-cur="peoplelis">
  10. <view class='cuIcon-peoplelist'></view>审批
  11. </view>
  12. <view :class="PageCur=='profile'?'action text-green':'action text-gray'" @click="NavChange" data-cur="profile">
  13. <view class='cuIcon-profile'></view>发起
  14. </view> -->
  15. <view :class="PageCur=='people'?'action text-green':'action text-gray'" @click="NavChange" data-cur="people">
  16. <view class='cuIcon-people'></view>个人
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. PageCur: 'home',
  26. commponent1Key: 0,
  27. commponent2Key: 0,
  28. }
  29. },
  30. onLoad:function(){
  31. this.PageCur='home'
  32. ++this.commponent1Key
  33. ++this.commponent2Key
  34. },
  35. methods: {
  36. NavChange: function(e) {
  37. this.PageCur = e.currentTarget.dataset.cur
  38. }
  39. }
  40. }
  41. </script>
  42. <style>
  43. </style>