瀏覽代碼

add: 图片上传框位置参数可传

zhengyingya 5 年之前
父節點
當前提交
7a06eef4b7
共有 2 個檔案被更改,包括 11 行新增2 行删除
  1. 9
    1
      src/components/Editor/index.js
  2. 2
    1
      src/index.js

+ 9
- 1
src/components/Editor/index.js 查看文件

174
       showUpload,
174
       showUpload,
175
       multiple,
175
       multiple,
176
       emojiPopoverPlacement,
176
       emojiPopoverPlacement,
177
+      uploadPopoverPlacement,
178
+      uploadOverlayClassName,
177
       closeUploadWhenBlur,
179
       closeUploadWhenBlur,
178
       maxUpload,
180
       maxUpload,
179
       // btnSubmitText,
181
       // btnSubmitText,
249
                   trigger="click"
251
                   trigger="click"
250
                   // TODO: 针对非 react.js,直接使用 click 事件来控制展开或关闭
252
                   // TODO: 针对非 react.js,直接使用 click 事件来控制展开或关闭
251
                   // visible={this.state.showUpload}
253
                   // visible={this.state.showUpload}
254
+                  placement={uploadPopoverPlacement}
255
+                  overlayClassName={uploadOverlayClassName}
256
+                  autoAdjustOverflow={false}
252
                   overlayStyle={{ zIndex: 999 }}
257
                   overlayStyle={{ zIndex: 999 }}
253
                   onVisibleChange={
258
                   onVisibleChange={
254
                     closeUploadWhenBlur
259
                     closeUploadWhenBlur
277
                       <div className="clearfix" />
282
                       <div className="clearfix" />
278
                     </div>
283
                     </div>
279
                   }
284
                   }
280
-                  placement="bottomLeft"
281
                   title={
285
                   title={
282
                     <div style={{ margin: "5px auto" }}>
286
                     <div style={{ margin: "5px auto" }}>
283
                       <span>
287
                       <span>
348
   showEmoji: PropTypes.bool,
352
   showEmoji: PropTypes.bool,
349
   emojiPopoverPlacement: PropTypes.string,
353
   emojiPopoverPlacement: PropTypes.string,
350
   showUpload: PropTypes.bool,
354
   showUpload: PropTypes.bool,
355
+  uploadPopoverPlacement: PropTypes.string,
356
+  uploadOverlayClassName: PropTypes.string,
351
   multiple: PropTypes.bool,
357
   multiple: PropTypes.bool,
352
   closeUploadWhenBlur: PropTypes.bool,
358
   closeUploadWhenBlur: PropTypes.bool,
353
   maxUpload: PropTypes.number,
359
   maxUpload: PropTypes.number,
374
   multiple: true,
380
   multiple: true,
375
   emojiPopoverPlacement: "bottomLeft",
381
   emojiPopoverPlacement: "bottomLeft",
376
   closeUploadWhenBlur: false,
382
   closeUploadWhenBlur: false,
383
+  uploadPopoverPlacement: "bottomLeft",
384
+  uploadOverlayClassName: "",
377
   maxUpload: 1,
385
   maxUpload: 1,
378
   // btnSubmitText: "发表",
386
   // btnSubmitText: "发表",
379
   btnLoading: false,
387
   btnLoading: false,

+ 2
- 1
src/index.js 查看文件

54
       console.log(c);
54
       console.log(c);
55
     },
55
     },
56
     editorProps: {
56
     editorProps: {
57
-      // emojiPopoverPlacement: "bottom"
57
+      // emojiPopoverPlacement: "bottom",
58
+      uploadPopoverPlacement: "top"
58
     }
59
     }
59
   });
60
   });
60
 }
61
 }