1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <template>
- <div class="index">
- <Loading v-show="LOADING"></Loading>
- <!-- <keep-alive>
- <router-view></router-view>
- </keep-alive> -->
- <keep-alive>
- <router-view v-if="$route.meta.keepAlive" />
- </keep-alive>
- <router-view v-if="!$route.meta.keepAlive" />
- <van-tabbar v-model="active" v-if="type === 1">
- <van-tabbar-item to="/punch" icon="location-o">打卡</van-tabbar-item>
- <van-tabbar-item to="/statistics" icon="records">统计</van-tabbar-item>
- </van-tabbar>
- </div>
- </template>
- <script>
- import { mapState } from "vuex";
- import { getStore } from "@/utils/store";
- import Loading from "@/components/loading";
- export default {
- name: "Index",
- components: {
- Loading,
- },
- data() {
- return {
- active: 0,
- type: getStore({'name':'type','type':'','debug':''})
- };
- },
- computed: {
- ...mapState(["LOADING"]),
- },
- watch: {},
- mounted() {
- this.initial();
- },
- methods: {
- initial() {},
- },
- };
- </script>
- <style scoped lang="scss">
- .index {
- width: 100%;
- height: 100%;
- position: relative;
- overflow: hidden;
- }
- /deep/ .van-tabbar {
- border-top: 1px solid #aaa;
- }
- </style>
|