Browse Source

feat: 上传图片使用点击外部区域来关闭上传的popover

node 6 years ago
parent
commit
7bd795bea0

+ 1
- 1
assets/example.html View File

@@ -20,7 +20,7 @@
20 20
   </div>
21 21
   
22 22
   <script src="http://gosspublic.alicdn.com/aliyun-oss-sdk.min.js"></script>
23
-  <script type="text/javascript" src="./static/js/main.9d10db91.js"></script>
23
+  <script type="text/javascript" src="./static/js/main.2917e503.js"></script>
24 24
   <script type="text/javascript" src="example.js"></script>
25 25
 </body>
26 26
 </html>

assets/static/js/main.2917e503.js
File diff suppressed because it is too large
View File


+ 1
- 0
assets/static/js/main.2917e503.js.map
File diff suppressed because it is too large
View File


+ 0
- 1
assets/static/js/main.9d10db91.js.map
File diff suppressed because it is too large
View File


+ 8
- 4
src/components/Editor/index.js View File

@@ -236,7 +236,8 @@ class Editor extends React.Component {
236 236
               {showUpload ? (
237 237
                 <Popover
238 238
                   trigger="click"
239
-                  visible={this.state.showUpload}
239
+                  // TODO: 针对非 react.js,直接使用 click 事件来控制展开或关闭
240
+                  // visible={this.state.showUpload}
240 241
                   overlayStyle={{ zIndex: 999 }}
241 242
                   onVisibleChange={
242 243
                     closeUploadWhenBlur
@@ -271,11 +272,14 @@ class Editor extends React.Component {
271 272
                         上传图片
272 273
                         {maxUpload >= 2 ? (
273 274
                           <span style={{ color: "#666", fontWeight: 400 }}>
274
-                            (您还能上传{maxUpload - this.state.fileList.length}张图片)
275
+                            (您还能上传
276
+                            {maxUpload - this.state.fileList.length}
277
+                            张图片)
275 278
                           </span>
276 279
                         ) : null}
277 280
                       </span>
278
-                      <Icon
281
+                      {/* 因为是点击别的区域关闭,所以不用右上角的 Icon */}
282
+                      {/* <Icon
279 283
                         type="close"
280 284
                         onClick={() => this.handleShowUpload(false)}
281 285
                         style={{
@@ -283,7 +287,7 @@ class Editor extends React.Component {
283 287
                           cursor: "pointer",
284 288
                           marginTop: 4
285 289
                         }}
286
-                      />
290
+                      /> */}
287 291
                     </div>
288 292
                   }
289 293
                 >