diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue
index 6bab39d..d6649ef 100644
--- a/src/components/Editor/index.vue
+++ b/src/components/Editor/index.vue
@@ -1,74 +1,135 @@
-
+
+
+
+
-
+ // 单个文件的最大体积限制,默认为 10M
+ maxFileSize: 5 * 1024 * 1024, // 5M
+
+ // 最多可上传几个文件,默认为 5
+ maxNumberOfFiles: 3,
+
+ // 选择文件时的类型限制,默认为 ['video/*'] 。如不想限制,则设置为 []
+ allowedFileTypes: ['video/*'],
+
+ // 将 meta 拼接到 url 参数中,默认 false
+ metaWithUrl: false,
+
+ // 自定义增加 http header
+ headers: {
+ Authorization: 'Bearer ' + getToken(),
+ userid: useUserStore().userId,
+ },
+
+ // 跨域是否传递 cookie ,默认为 false
+ withCredentials: true,
+ // 超时时间,默认为 30 秒
+ timeout: 15 * 1000, // 15 秒
+ // 自定义插入视频
+ customInsert(res, insertFn) {
+ ;-(
+ // 从 res 中找到 url alt href ,然后插图图片
+ insertFn(res.data.url)
+ )
+ },
+ }
+ onBeforeUnmount(() => {
+ const editor = editorRef.value
+ if (editor == null) return
+ editor.destroy()
+ })
+ const handleCreated = (editor) => {
+ editorRef.value = editor
+ }
+ const handleChange = (editor) => {
+ emit('update:modelValue', editor.getHtml())
+ }
+ watch(
+ () => props.modelValue,
+ (value) => {
+ const editor = editorRef.value
+ if (value == undefined) {
+ editor.clear()
+ return
+ }
+ valueHtml.value = value;
+ },
+ )
+ return {
+ editorRef,
+ valueHtml,
+ mode: 'default',
+ toolbarConfig,
+ editorConfig,
+ handleCreated,
+ handleChange,
+ }
+ },
+}
+
\ No newline at end of file