测试新编辑器

- 尝试修复手机浏览器看不见底部栏的bug
This commit is contained in:
Guarp 2025-02-22 19:32:46 +08:00
parent eda2d71cb6
commit e4fdd241a3
2 changed files with 7 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import {onMounted, onUnmounted, ref, watch} from "vue";
import store from "../store/index.js";
import swal from "../utils/sweetalert.js";
import getCurrentTime from "../utils/getCurrentTime.js";
import mobileTest from "../utils/mobileTest.js";
const contentInput = ref(store.state.editStore.blog || '');
const titleInput = ref(store.state.editStore.blogTitle || '')
@ -124,7 +125,7 @@ onUnmounted(() => {
<input placeholder="输入标题" v-model="titleInput">
</div>
<div class="top">
<div class="function-btn">
<div class="function-btn" :style="{flex: isMobileMode?1:3}">
<button v-if="! isMobileMode" v-for="btn in funcButtons" v-html="btn.name" @click="clickFuncBtn(btn.func)"/>
<button v-if="isMobileMode" @click="isMenuOpen = ! isMenuOpen"></button>
<div v-if="isMobileMode && isMenuOpen" class="function-btn-menu">
@ -141,7 +142,7 @@ onUnmounted(() => {
<button>提交</button>
</div>
</div>
<div class="middle">
<div class="middle" :style="{maxHeight: `calc(100% - ${mobileTest() ? 200 : 125}px)`}">
<div v-if="portMode !== 'view'" class="left">
<textarea v-model="contentInput"></textarea>
</div>

4
src/utils/mobileTest.js Normal file
View File

@ -0,0 +1,4 @@
export default function mobileTest() {
const userAgent = navigator.userAgent.toLowerCase();
return /mobile/i.test(userAgent) || /android/i.test(userAgent) || /iphone/i.test(userAgent);
}