Skip to content

Commit dee84e9

Browse files
committed
fix: iOS安全距离和输入溢出[Chanzhaoyu#266]
1 parent 0fdf75e commit dee84e9

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/styles/global.less

+4
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ body,
33
#app {
44
height: 100%;
55
}
6+
7+
body {
8+
padding-bottom: constant(safe-area-inset-bottom);
9+
}

src/views/chat/index.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ const wrapClass = computed(() => {
333333
const footerClass = computed(() => {
334334
let classes = ['p-4']
335335
if (isMobile.value)
336-
classes = ['sticky', 'left-0', 'bottom-0', 'right-0', 'p-2', 'pr-4', 'h-14', 'overflow-hidden']
336+
classes = ['sticky', 'left-0', 'bottom-0', 'right-0', 'p-2', 'pr-4', 'overflow-hidden']
337337
return classes
338338
})
339339

src/views/chat/layout/sider/index.vue

+10-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ const getMobileClass = computed<CSSProperties>(() => {
3232
return {}
3333
})
3434
35+
const mobileSafeArea = computed(() => {
36+
if (isMobile.value) {
37+
return {
38+
paddingBottom: 'env(safe-area-inset-bottom)',
39+
}
40+
}
41+
return {}
42+
})
43+
3544
watch(
3645
isMobile,
3746
(val) => {
@@ -56,7 +65,7 @@ watch(
5665
:style="getMobileClass"
5766
@update-collapsed="handleUpdateCollapsed"
5867
>
59-
<div class="flex flex-col h-full">
68+
<div class="flex flex-col h-full" :style="mobileSafeArea">
6069
<main class="flex flex-col flex-1 min-h-0">
6170
<div class="p-4">
6271
<NButton dashed block @click="handleAdd">

0 commit comments

Comments
 (0)