diff --git a/frontend_nuxt/utils/vditor.js b/frontend_nuxt/utils/vditor.js index 11adebc5d..c38aed7b1 100644 --- a/frontend_nuxt/utils/vditor.js +++ b/frontend_nuxt/utils/vditor.js @@ -2,7 +2,6 @@ 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' @@ -34,8 +33,7 @@ export function createVditor(editorId, options = {}) { return searchUsers(value) } - const isMobile = useIsMobile() - + const isMobile = window.innerWidth <= 768 const toolbar = isMobile ? ['emoji', 'upload'] : [ @@ -166,7 +164,7 @@ export function createVditor(editorId, options = {}) { // } // } // }, - toolbarConfig: { pin: isMobile ? false : true }, + toolbarConfig: { pin: true }, cache: { enable: false }, input, after,