Index.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <div class="index">
  3. <Loading v-show="LOADING"></Loading>
  4. <!-- <keep-alive>
  5. <router-view></router-view>
  6. </keep-alive> -->
  7. <keep-alive>
  8. <router-view v-if="$route.meta.keepAlive" />
  9. </keep-alive>
  10. <router-view v-if="!$route.meta.keepAlive" />
  11. <van-tabbar v-model="active" v-if="type === 1">
  12. <van-tabbar-item to="/punch" icon="location-o">打卡</van-tabbar-item>
  13. <van-tabbar-item to="/statistics" icon="records">统计</van-tabbar-item>
  14. </van-tabbar>
  15. </div>
  16. </template>
  17. <script>
  18. import { mapState } from "vuex";
  19. import { getStore } from "@/utils/store";
  20. import Loading from "@/components/loading";
  21. export default {
  22. name: "Index",
  23. components: {
  24. Loading,
  25. },
  26. data() {
  27. return {
  28. active: 0,
  29. type: getStore({'name':'type','type':'','debug':''})
  30. };
  31. },
  32. computed: {
  33. ...mapState(["LOADING"]),
  34. },
  35. watch: {},
  36. mounted() {
  37. this.initial();
  38. },
  39. methods: {
  40. initial() {},
  41. },
  42. };
  43. </script>
  44. <style scoped lang="scss">
  45. .index {
  46. width: 100%;
  47. height: 100%;
  48. position: relative;
  49. overflow: hidden;
  50. }
  51. /deep/ .van-tabbar {
  52. border-top: 1px solid #aaa;
  53. }
  54. </style>