naive-ui/demo/documentation/components/upload/enUS/onFinish.md

21 lines
434 B
Markdown
Raw Normal View History

2020-02-18 20:09:34 +08:00
# Change File on Finish
You can change file's property when upload finishes.
```html
<div style="overflow: hidden">
<n-upload
:on-finish="handleFinish"
action="http://www.mocky.io/v2/5e4bafc63100007100d8b70f"
>
<n-button>Upload</n-button>
</n-upload>
</div>
```
```js
export default {
methods: {
handleFinish (file, response) {
file.url = 'http://www.mocky.io/v2/5e4bafc63100007100d8b70f'
}
}
}
```