add messages
This commit is contained in:
@@ -72,6 +72,13 @@ const options: Array<DropdownOption | DropdownDividerOption> = [
|
||||
onClick: () => router.push("/user"),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "我的消息",
|
||||
key: "message",
|
||||
props: {
|
||||
onClick: () => router.push("/message"),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "我的提交",
|
||||
key: "status",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user