mirror of
https://github.com/talktao/Vue3-Vite-Vant-TS-H5.git
synced 2025-04-06 03:57:55 +08:00
chroe:使用RequestLoading组件
This commit is contained in:
parent
17ade1be2c
commit
cf2924f075
@ -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>
|
Loading…
x
Reference in New Issue
Block a user