feat: 调整项目结构
This commit is contained in:
37
src/pages/index/components/chat/ChatTopNavBar/index.vue
Normal file
37
src/pages/index/components/chat/ChatTopNavBar/index.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<view class="nav-bar">
|
||||
<view class="nav-item" @click="showDrawer('showLeft')">
|
||||
<uni-icons type="bars" size="24" color="#333"></uni-icons>
|
||||
</view>
|
||||
|
||||
<uni-drawer ref="showLeft" mode="left" :width="320">
|
||||
<DrawerHome @closeDrawer="closeDrawer('showLeft')" />
|
||||
</uni-drawer>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import DrawerHome from "../../drawer/DrawerHome/index.vue";
|
||||
import { checkToken } from "@/hooks/useGoLogin";
|
||||
const showLeft = ref(false);
|
||||
|
||||
// 打开窗口
|
||||
const showDrawer = async (e) => {
|
||||
await checkToken();
|
||||
|
||||
showLeft.value.open();
|
||||
// 发送抽屉显示事件
|
||||
uni.$emit("drawerShow");
|
||||
};
|
||||
// 关闭窗口
|
||||
const closeDrawer = (e) => {
|
||||
showLeft.value.close();
|
||||
// 发送抽屉隐藏事件
|
||||
uni.$emit("drawerHide");
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@use "./styles/index.scss";
|
||||
</style>
|
||||
Reference in New Issue
Block a user