mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
fix(upload): file is set to null
after upload failure, closes #1316
This commit is contained in:
parent
23a7f24888
commit
134aa49ecd
@ -6,6 +6,7 @@
|
||||
|
||||
- Fix `n-collapse`'s expanded status is lost when using `v-if` with `n-collapse-item`, closes [#1387](https://github.com/TuSimple/naive-ui/issues/1387).
|
||||
- Fix `n-dialog`'s close button will be overlayed with content, closes [#1381](https://github.com/TuSimple/naive-ui/issues/1381).
|
||||
- Fix `n-upload` file is set to `null` after upload failure, closes [#1316](https://github.com/TuSimple/naive-ui/issues/1316).
|
||||
|
||||
### Feats
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
- 修复 `n-collapse` 在 `n-collapse-item` 使用 `v-if` 是展开状态丢失,关闭 [#1387](https://github.com/TuSimple/naive-ui/issues/1387)
|
||||
- 修复 `n-dialog` 的关闭按钮会被内容遮盖,关闭 [#1381](https://github.com/TuSimple/naive-ui/issues/1381)
|
||||
- 修复 `n-upload` 上传失败后重试时文件为 `null`,关闭 [#1316](https://github.com/TuSimple/naive-ui/issues/1316)
|
||||
|
||||
### Feats
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Custom Action
|
||||
# Customize action
|
||||
|
||||
Sometimes you may want to customize `action` and `content` .
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Click on Mask
|
||||
# Click on mask
|
||||
|
||||
I think user is smart enough that they know if nothing happens after mask is clicked, they should click at confirm or cancel button.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Use as a Component
|
||||
# Use as a component
|
||||
|
||||
Sometimes you may want to use a component.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Split Trigger and List
|
||||
# Split trigger and list
|
||||
|
||||
Set `abstract` on `n-upload`.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Before Upload Hook
|
||||
# Before upload hook
|
||||
|
||||
Use `before-upload` to prevent uploading.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Controlled File List
|
||||
# Controlled file list
|
||||
|
||||
Example is only a joke.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Default File List
|
||||
# Default file list
|
||||
|
||||
```html
|
||||
<n-upload
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Drag to Upload
|
||||
# Drag to upload
|
||||
|
||||
```html
|
||||
<n-upload action="__HTTP__://www.mocky.io/v2/5e4bafc63100007100d8b70f">
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Pictures Wall
|
||||
# Pictures wall
|
||||
|
||||
`list-type = "image-card"`.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Thumbnail File List
|
||||
# Thumbnail file list
|
||||
|
||||
`list-type = "image"`.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Change File on Finish
|
||||
# Change file on finish
|
||||
|
||||
You can change file's property when upload finishes.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Uncontrolled Manually Submit
|
||||
# Uncontrolled manually submit
|
||||
|
||||
You can use `submit` method to submit in uncontrolled manner. Also you can do it in controlled manner in another way.
|
||||
|
||||
|
@ -15,6 +15,7 @@ before-upload
|
||||
image-style
|
||||
image-card-style
|
||||
abstract
|
||||
retry-debug
|
||||
```
|
||||
|
||||
## API
|
||||
|
5
src/upload/demos/zhCN/retry-debug.demo.md
Normal file
5
src/upload/demos/zhCN/retry-debug.demo.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Retry debug
|
||||
|
||||
```html
|
||||
<n-upload action="http://fake-api"><n-button>Upload</n-button></n-upload>
|
||||
```
|
@ -79,8 +79,7 @@ function createXhrHandlers (
|
||||
handleXHRError (e) {
|
||||
const fileAfterChange: FileInfo = Object.assign({}, file, {
|
||||
status: 'error',
|
||||
percentage,
|
||||
file: null
|
||||
percentage
|
||||
})
|
||||
XhrMap.delete(file.id)
|
||||
doChange(fileAfterChange, e)
|
||||
|
Loading…
Reference in New Issue
Block a user