naive-ui/demo/documentation/components/upload/zhCN/basic.md
2020-02-18 19:24:45 +08:00

445 B

基础用法

<div style="overflow: hidden">
  <n-upload
    action="http://www.mocky.io/v2/5e4bafc63100007100d8b70f"
    :headers="{
      'naive-info': 'hello!'
    }"
    :data="{
      'naive-data': 'cool! naive!'
    }"
    @change="handleChange"
  >
    <n-button>上传文件</n-button>
  </n-upload>
</div>
export default {
  methods: {
    handleChange (change) {
      console.log(change.file.status)
    }
  }
}