Browse Source

:sparkles: add options.upload.setHeaders

Liyuan Li 5 years ago
parent
commit
f7a2fe9dae
2 changed files with 1 additions and 2 deletions
  1. 0 1
      demo/index.js
  2. 1 1
      types/index.d.ts

+ 0 - 1
demo/index.js

@@ -17,7 +17,6 @@ window.vditor = new Vditor('vditor', {
     enable: true,
     type: 'text'
   },
-  height: 500,
   hint: {
     emojiPath: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/images/emoji',
     emojiTail: '<a href="https://hacpai.com/settings/function" target="_blank">设置常用表情</a>',

+ 1 - 1
types/index.d.ts

@@ -139,7 +139,7 @@ interface IUpload {
     headers?: { [key: string]: string };
 
     /** 每次上传前都会重新设置请求头 */
-    setHeaders(): { [key: string]: string };
+    setHeaders?(): { [key: string]: string };
 
     /** 上传成功回调 */
     success?(editor: HTMLPreElement, msg: string): void;