From 1fc6460ae0b77ea413a8b6f5bfc3ed0a84613b16 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 15 Aug 2025 00:01:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dvditor=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E8=B4=B4=E9=A1=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend_nuxt/utils/vditor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend_nuxt/utils/vditor.js b/frontend_nuxt/utils/vditor.js index c38aed7b1..11adebc5d 100644 --- a/frontend_nuxt/utils/vditor.js +++ b/frontend_nuxt/utils/vditor.js @@ -2,6 +2,7 @@ import Vditor from 'vditor' import { getToken, authState } from './auth' import { searchUsers, fetchFollowings, fetchAdmins } from './user' import { tiebaEmoji } from './tiebaEmoji' +import { useIsMobile } from './screen' export function getEditorTheme() { return document.documentElement.dataset.theme === 'dark' ? 'dark' : 'classic' @@ -33,7 +34,8 @@ export function createVditor(editorId, options = {}) { return searchUsers(value) } - const isMobile = window.innerWidth <= 768 + const isMobile = useIsMobile() + const toolbar = isMobile ? ['emoji', 'upload'] : [ @@ -164,7 +166,7 @@ export function createVditor(editorId, options = {}) { // } // } // }, - toolbarConfig: { pin: true }, + toolbarConfig: { pin: isMobile ? false : true }, cache: { enable: false }, input, after,