chroe:使用RequestLoading组件

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

@ -1,34 +1,33 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, toRefs } from 'vue' import { ref, reactive, toRefs } from "vue";
//tab //tab
const useTabBar = () => { const useTabBar = () => {
const state = reactive({ const state = reactive({
tabBar: [ tabBar: [
{ {
title: '首页', title: "首页",
to: { to: {
name: 'Home' name: "Home",
}, },
icon: 'home-o' icon: "home-o",
}, },
{ {
title: '我', title: "我",
to: { to: {
name:'About' name: "About",
}, },
icon: 'user-o' icon: "user-o",
} },
] ],
}) });
return toRefs(state) return toRefs(state);
} };
const { tabBar } = useTabBar() const { tabBar } = useTabBar();
const handleChange = (value) => { const handleChange = (value) => {
// console.log(value,'valueeeeeee'); // console.log(value,'valueeeeeee');
} };
</script> </script>
<template> <template>
@ -38,6 +37,7 @@ const handleChange = (value) => {
<router-view></router-view> <router-view></router-view>
</keep-alive> </keep-alive>
<router-view v-else></router-view> <router-view v-else></router-view>
<RequestLoading></RequestLoading>
</div> </div>
<div class="layout-footer"> <div class="layout-footer">
<TabBar :data="tabBar" @chang="handleChange"></TabBar> <TabBar :data="tabBar" @chang="handleChange"></TabBar>
@ -46,5 +46,4 @@ const handleChange = (value) => {
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>