naive-ui/demo/documentation/components/upload/enUS/on-finish.demo.md
2020-10-22 13:49:51 +08:00

375 B

Change File on Finish

You can change file's property when upload finishes.

<n-upload
  @finish="handleFinish"
  action="http://www.mocky.io/v2/5e4bafc63100007100d8b70f"
>
  <n-button>Upload</n-button>
</n-upload>
export default {
  methods: {
    handleFinish ({ file }) {
      file.url = 'http://www.mocky.io/v2/5e4bafc63100007100d8b70f'
    }
  }
}