feat: add new post page mobile

This commit is contained in:
Tim
2025-07-21 17:48:43 +08:00
parent 50a6db2da1
commit 9e729f1166
4 changed files with 41 additions and 3 deletions
+8
View File
@@ -72,6 +72,10 @@ body {
box-shadow: none !important; box-shadow: none !important;
} */ } */
/* .vditor-toolbar {
position: relative !important;
} */
/************************* /*************************
* Markdown 渲染样式 * Markdown 渲染样式
*************************/ *************************/
@@ -173,6 +177,10 @@ body {
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.vditor-toolbar {
display: none;
}
.about-content h1, .about-content h1,
.info-content-text h1 { .info-content-text h1 {
font-size: 20px; font-size: 20px;
@@ -23,6 +23,7 @@ import Vditor from 'vditor'
import { themeState } from '../utils/theme' import { themeState } from '../utils/theme'
import 'vditor/dist/index.css' import 'vditor/dist/index.css'
import LoginOverlay from './LoginOverlay.vue' import LoginOverlay from './LoginOverlay.vue'
import { isMobile } from '../utils/screen'
export default { export default {
name: 'CommentEditor', name: 'CommentEditor',
@@ -72,7 +73,7 @@ export default {
onMounted(() => { onMounted(() => {
vditorInstance.value = new Vditor(props.editorId, { vditorInstance.value = new Vditor(props.editorId, {
placeholder: '说点什么...', placeholder: '说点什么...',
height: 200, height: isMobile.value ? 'auto' : 200,
theme: getEditorTheme(), theme: getEditorTheme(),
preview: { preview: {
actions: [], actions: [],
@@ -175,4 +176,10 @@ export default {
.comment-submit:hover { .comment-submit:hover {
background-color: var(--primary-color-hover); background-color: var(--primary-color-hover);
} }
@media (max-width: 768px) {
.comment-editor-container {
margin-bottom: 10px;
}
}
</style> </style>
+1 -1
View File
@@ -93,7 +93,7 @@ export default {
name: 'BaseDropdown', name: 'BaseDropdown',
props: { props: {
modelValue: { type: [Array, String, Number], default: () => [] }, modelValue: { type: [Array, String, Number], default: () => [] },
placeholder: { type: String, default: '请选择' }, placeholder: { type: String, default: '返回' },
multiple: { type: Boolean, default: false }, multiple: { type: Boolean, default: false },
fetchOptions: { type: Function, required: true }, fetchOptions: { type: Function, required: true },
remote: { type: Boolean, default: false }, remote: { type: Boolean, default: false },
+24 -1
View File
@@ -266,7 +266,6 @@ export default {
} }
.post-title-input { .post-title-input {
font-size: 18px;
border: none; border: none;
outline: none; outline: none;
padding-top: 20px; padding-top: 20px;
@@ -341,18 +340,42 @@ export default {
.post-options-left { .post-options-left {
display: flex; display: flex;
gap: 10px; gap: 10px;
flex-wrap: wrap;
} }
.post-options-right { .post-options-right {
margin-top: 10px;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 30px; gap: 30px;
row-gap: 10px;
flex-wrap: wrap;
} }
.post-options { .post-options {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
flex-wrap: wrap;
margin-top: 20px; margin-top: 20px;
} }
@media (max-width: 768px) {
.new-post-page {
width: calc(100vw - 20px);
padding-right: 10px;
padding-left: 10px;
overflow-x: hidden;
}
.post-title-input {
font-size: 24px;
padding-top: 10px;
padding-bottom: 10px;
}
.post-options {
margin-top: 10px;
}
}
</style> </style>