naive-ui/demo/documentation/components/upload/enUS/on-finish.demo.md

19 lines
375 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
2020-10-22 13:49:51 +08:00
<n-upload
@finish="handleFinish"
action="http://www.mocky.io/v2/5e4bafc63100007100d8b70f"
>
<n-button>Upload</n-button>
</n-upload>
2020-02-18 20:09:34 +08:00
```
```js
export default {
methods: {
2020-03-20 15:42:36 +08:00
handleFinish ({ file }) {
2020-02-18 20:09:34 +08:00
file.url = 'http://www.mocky.io/v2/5e4bafc63100007100d8b70f'
}
}
}
```