1.1.5 • Published 4 years ago

osx-upload v1.1.5

Weekly downloads
5
License
ISC
Repository
github
Last release
4 years ago

OSX 系列组件

osx-upload 上传组件

参数说明

参数作用
ref通过ref获取元素
multiple多选
paramsbody上传的参数
action上传的地址
limit限制文件的个数
max-size文件最大容量,1 表示1M
upload-way上传的方式,aync:异步,sync:同步
list-style文件排列的方式
button-type上传的按钮的类型 default,primary,danger
circle圆形按钮

用例

  1. 在main.js中注册组件
import OSXUpload from 'osx-upload'
Vue.use(OSXUpload)
<template>
  <div class="hello">
    <osx-upload
      ref="upload"
      :on-change="changeFile"
      :on-remove="removeFile"
      :on-preview="previewFile"
      :on-progress="progress"
      :on-exceed="exceed"
      :on-success="success"
      :on-fail="failed"
      :maxSize="5"
      button-type='primary'
      multiple
      circle
      :params="{locatedId:1110}"
      action="http://localhost:3003/upload"
      upload-way="async"
      list-style="text"
      :limit="3"
    >
    <!-- 此处插入任意元素  -->
      上传
    </osx-upload>
    <button @click="upload">提交</button>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  methods: {
    clear () {
      this.$refs.upload.clearFiles()
    },
    upload () {
      this.$refs.upload.uploadFiles()
    },
    changeFile (file, fileList) {
      console.log(file, fileList)
    },
    removeFile (file, fileList) {},
    previewFile (file) {},
    progress (event, file, fileList) {},
    exceed (fileList) {},
    success (file, files) {
      console.log('上传成功', file, files)
    },
    failed (file, files) {
      console.log('上传失败', file, files)
    }
  }
}
</script>

<style scoped>

</style>
1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago