mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-18 01:47:25 +08:00
fix: 修复vditor移动端贴顶的问题
This commit is contained in:
@@ -2,6 +2,7 @@ import Vditor from 'vditor'
|
|||||||
import { getToken, authState } from './auth'
|
import { getToken, authState } from './auth'
|
||||||
import { searchUsers, fetchFollowings, fetchAdmins } from './user'
|
import { searchUsers, fetchFollowings, fetchAdmins } from './user'
|
||||||
import { tiebaEmoji } from './tiebaEmoji'
|
import { tiebaEmoji } from './tiebaEmoji'
|
||||||
|
import { useIsMobile } from './screen'
|
||||||
|
|
||||||
export function getEditorTheme() {
|
export function getEditorTheme() {
|
||||||
return document.documentElement.dataset.theme === 'dark' ? 'dark' : 'classic'
|
return document.documentElement.dataset.theme === 'dark' ? 'dark' : 'classic'
|
||||||
@@ -33,7 +34,8 @@ export function createVditor(editorId, options = {}) {
|
|||||||
return searchUsers(value)
|
return searchUsers(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const isMobile = window.innerWidth <= 768
|
const isMobile = useIsMobile()
|
||||||
|
|
||||||
const toolbar = isMobile
|
const toolbar = isMobile
|
||||||
? ['emoji', 'upload']
|
? ['emoji', 'upload']
|
||||||
: [
|
: [
|
||||||
@@ -164,7 +166,7 @@ export function createVditor(editorId, options = {}) {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
toolbarConfig: { pin: true },
|
toolbarConfig: { pin: isMobile ? false : true },
|
||||||
cache: { enable: false },
|
cache: { enable: false },
|
||||||
input,
|
input,
|
||||||
after,
|
after,
|
||||||
|
|||||||
Reference in New Issue
Block a user