mirror of
https://github.com/talktao/Vue3-Vite-Vant-TS-H5.git
synced 2025-05-25 00:39:18 +08:00
49 lines
978 B
Vue
49 lines
978 B
Vue
<script setup lang="ts">
|
|
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 handleChange = (value) => {
|
|
// 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>
|
|
<RequestLoading></RequestLoading>
|
|
</div>
|
|
<div class="layout-footer">
|
|
<TabBar :data="tabBar" @chang="handleChange"></TabBar>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
</style> |