feat: 评论区支持高度调整

This commit is contained in:
Tim
2025-07-25 10:57:29 +08:00
parent f5447604d6
commit 0cf44c2a42
4 changed files with 9 additions and 5 deletions

View File

@@ -57,7 +57,9 @@ body {
/*************************
* Vditor 自定义皮肤覆写
*************************/
.vditor {
min-height: 200px;
}
/* .vditor {
--textarea-background-color: transparent;
border: none !important;
@@ -200,6 +202,10 @@ body {
}
@media (max-width: 768px) {
.vditor {
min-height: 100px;
}
.vditor-toolbar {
display: none;
}

View File

@@ -26,7 +26,6 @@ import {
getPreviewTheme as getPreviewThemeUtil
} from '../utils/vditor'
import LoginOverlay from './LoginOverlay.vue'
import { isMobile } from '../utils/screen'
export default {
name: 'CommentEditor',
@@ -74,7 +73,6 @@ export default {
onMounted(() => {
vditorInstance.value = createVditor(props.editorId, {
placeholder: '说点什么...',
height: isMobile.value ? 'auto' : 200,
preview: {
actions: [],
markdown: { toc: false }

View File

@@ -14,7 +14,6 @@ export function getPreviewTheme() {
export function createVditor(editorId, options = {}) {
const {
placeholder = '',
height,
preview = {},
input,
after
@@ -22,7 +21,7 @@ export function createVditor(editorId, options = {}) {
return new Vditor(editorId, {
placeholder,
height,
height: 'auto',
theme: getEditorTheme(),
preview: Object.assign({ theme: { current: getPreviewTheme() } }, preview),
cdn: 'https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/vditor',

View File

@@ -795,6 +795,7 @@ export default {
display: flex;
flex-direction: column;
gap: 10px;
width: 100%;
}
.info-content-header {