add messages

This commit is contained in:
2024-06-26 05:36:43 +00:00
parent 939a935ca1
commit 2add0e923f
9 changed files with 178 additions and 13 deletions

View File

@@ -72,6 +72,13 @@ const options: Array<DropdownOption | DropdownDividerOption> = [
onClick: () => router.push("/user"),
},
},
{
label: "我的消息",
key: "message",
props: {
onClick: () => router.push("/message"),
},
},
{
label: "我的提交",
key: "status",

View File

@@ -6,6 +6,7 @@ import { uploadImage } from "../../admin/api"
interface Props {
title: string
simple?: boolean
minHeight?: number
}
@@ -14,6 +15,7 @@ type InsertFnType = (url: string, alt: string, href: string) => void
const props = withDefaults(defineProps<Props>(), {
minHeight: 0,
simple: false,
})
const message = useMessage()
@@ -52,6 +54,20 @@ const toolbarConfig: Partial<IToolbarConfig> = {
],
}
const toolbarConfigSimple: Partial<IToolbarConfig> = {
toolbarKeys: [
"bold",
"color",
"bgColor",
"emotion",
"uploadImage",
"insertLink",
"clearStyle",
"undo",
"redo",
],
}
const editorConfig: Partial<IEditorConfig> = {
scroll: false,
MENU_CONF: {
@@ -93,7 +109,7 @@ async function customUpload(file: File, insertFn: InsertFnType) {
<Toolbar
class="toolbar"
:editor="editorRef"
:defaultConfig="toolbarConfig"
:defaultConfig="props.simple ? toolbarConfigSimple : toolbarConfig"
mode="simple"
/>
<Editor