mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-24 12:45:18 +08:00
21 lines
434 B
Markdown
21 lines
434 B
Markdown
|
# 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'
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
```
|