wip: 临时提交

This commit is contained in:
ray
2025-05-28 08:21:01 +08:00
parent 54ab9f6f44
commit b2333e8b70
58 changed files with 5078 additions and 4337 deletions

4
src/layouts/default.vue Normal file
View File

@@ -0,0 +1,4 @@
<template>
<div>默认布局</div>
<slot></slot>
</template>

84
src/layouts/tabbar.vue Normal file
View File

@@ -0,0 +1,84 @@
<!--
* @Author: weisheng
* @Date: 2024-11-01 12:31:47
* @LastEditTime: 2024-11-14 19:02:06
* @LastEditors: weisheng
* @Description:
* @FilePath: \wot-demo\src\layouts\tabbar.vue
* 记得注释
-->
<script lang="ts" setup>
import { useTabbar } from "@/composables/useTabbar";
import { useTheme } from "@/composables/theme/theme";
const router = useRouter();
const route = useRoute();
const { themeVars, theme } = useTheme();
const { activeTabbar, getTabbarItemValue, setTabbarItemActive, tabbarList } = useTabbar();
function handleTabbarChange({ value }: { value: string }) {
setTabbarItemActive(value);
router.pushTab({ name: value });
}
onMounted(() => {
nextTick(() => {
if (route.name && route.name !== activeTabbar.value.name) {
setTabbarItemActive(route.name);
}
});
});
onShow(() => {
// #ifdef APP-PLUS
uni.hideTabBar();
// #endif
});
</script>
<script lang="ts">
export default {
options: {
addGlobalClass: true,
virtualHost: true,
styleIsolation: "shared",
},
};
</script>
<template>
<wd-config-provider :theme-vars="themeVars" custom-style="min-height: 100vh" :theme="theme">
<wd-navbar
:title="activeTabbar.title"
safe-area-inset-top
placeholder
fixed
:bordered="false"
/>
<slot />
<wd-tabbar
:model-value="activeTabbar.name"
placeholder
bordered
safe-area-inset-bottom
fixed
@change="handleTabbarChange"
>
<wd-tabbar-item
v-for="(item, index) in tabbarList"
:key="index"
:name="item.name"
:value="getTabbarItemValue(item.name)"
:title="item.title"
:icon="item.icon"
/>
</wd-tabbar>
<wd-notify />
<wd-toast />
<wd-message-box />
</wd-config-provider>
</template>