feat: 抽屉效果再app不兼容问题处理
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
<ChatTopNavBar
|
||||
ref="topNavBarRef"
|
||||
:mainPageDataModel="mainPageDataModel"
|
||||
@showDrawer="handleShowDrawer"
|
||||
/>
|
||||
</view>
|
||||
|
||||
@@ -257,6 +258,7 @@ import { checkToken } from "@/hooks/useGoLogin";
|
||||
import { useAppStore } from "@/store";
|
||||
import { getAccessToken } from "@/constant/token";
|
||||
|
||||
const emit = defineEmits(["showDrawer"]);
|
||||
const appStore = useAppStore();
|
||||
/// 导航栏相关
|
||||
const statusBarHeight = ref(20);
|
||||
@@ -331,6 +333,10 @@ const handleChange = (i) => {
|
||||
console.log("切换:", i);
|
||||
};
|
||||
|
||||
const handleShowDrawer = () => {
|
||||
emit("showDrawer");
|
||||
};
|
||||
|
||||
/// =============事件函数↓================
|
||||
const handleTouchEnd = () => {
|
||||
clearTimeout(holdKeyboardTimer.value);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<view class="border-box h-44 flex flex-items-center pl-12 pr-12">
|
||||
<uni-icons type="bars" size="24" color="#333" @click="showDrawer" />
|
||||
<view class="nav-icon-button" @tap.stop="showDrawer">
|
||||
<uni-icons type="bars" size="24" color="#ffffff" />
|
||||
</view>
|
||||
|
||||
<!-- 隐藏 -->
|
||||
<view class="flex-full h-full flex flex-items-center flex-justify-center">
|
||||
@@ -54,7 +56,9 @@ const spriteStyle = computed(() => {
|
||||
};
|
||||
});
|
||||
|
||||
const showDrawer = () => uni.$emit("SHOW_DRAWER");
|
||||
const emit = defineEmits(["showDrawer"]);
|
||||
|
||||
const showDrawer = () => emit("showDrawer");
|
||||
|
||||
defineExpose({ show });
|
||||
</script>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
.nav-icon-button {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
// 图片从0%到100%动画
|
||||
.image-animated {
|
||||
animation: logo-scale 0.3s ease-in-out;
|
||||
@@ -28,4 +36,4 @@
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user