chroe:使用RequestLoading组件

This commit is contained in:
tantao 2022-08-25 14:44:58 +08:00
parent 17ade1be2c
commit cf2924f075

View File

@ -1,50 +1,49 @@
<script setup lang="ts">
import { ref, reactive, toRefs } from 'vue'
import { ref, reactive, toRefs } from "vue";
//tab
const useTabBar = () => {
const state = reactive({
tabBar: [
{
title: '首页',
to: {
name: 'Home'
},
icon: 'home-o'
},
{
title: '我',
to: {
name:'About'
},
icon: 'user-o'
}
]
})
return toRefs(state)
}
const { tabBar } = useTabBar()
const state = reactive({
tabBar: [
{
title: "首页",
to: {
name: "Home",
},
icon: "home-o",
},
{
title: "我",
to: {
name: "About",
},
icon: "user-o",
},
],
});
return toRefs(state);
};
const { tabBar } = useTabBar();
const handleChange = (value) => {
// console.log(value,'valueeeeeee');
}
// console.log(value,'valueeeeeee');
};
</script>
<template>
<div class="app-container">
<div class="layout-content">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
</keep-alive>
<router-view v-else></router-view>
</div>
<div class="layout-footer">
<TabBar :data="tabBar" @chang="handleChange"></TabBar>
</div>
</div>
<div class="app-container">
<div class="layout-content">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
</keep-alive>
<router-view v-else></router-view>
<RequestLoading></RequestLoading>
</div>
<div class="layout-footer">
<TabBar :data="tabBar" @chang="handleChange"></TabBar>
</div>
</div>
</template>
<style lang="scss" scoped>
</style>