1.0.17 • Published 2 years ago

artronupload v1.0.17

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

上传组件

原生项目引入组件

<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.10/vue.min.js"></script>
<script src="https://components.artron.net/imgupload/ImgUploadCom.umd.js"></script>

<script src="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.9/index.js"></script>
<link rel="stylesheet" href="https://components.artron.net/imgupload/ImgUploadCom.css">
<link href="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.9/theme-chalk/index.css" rel="stylesheet">

<div id="app">
  <artronupload></artronupload>
</div>

<script>
new Vue({
  components: {
    artronupload: ImgUploadCom
  }
}).$mount('#app')
</script>

Vue项目引入组件

  npm i artronupload

页面引入组件

<script>
  import artronupload from 'artronupload'
  import 'artronupload/ImgUploadCom.css';
</script>

参数

   :width='300' 
   :height='300' 
   :max="9" 
   type='img'
   :draggable='true'
   :inputShow='true'
   uploaderauthUrl='https://write.artron.net/upload/getWebUploaderAuth' 
   :uploadedfileList='arr'
   objectFit='cover'
   @on-uploaded='uploaded' 
   @on-draggable='draggableed'

API

参数说明类型可选值默认值
type类型Stringimg, audio, video, pdf, word, excelimg
max最多上传数量Number--9
maxSize最大上传尺寸Number--1024 1024 200
width宽度Number--120
height高度Number--120
inputShow是否显示输入框Booleantrue,faslefalse
draggable是否可以拖拽Booleantrue,faslefalse
objectFit图片显示类型Stringcontain,covercontain
uploadedfileList回显上传文件Array--[]
sourceTypesourceTypeNumber----
configUrl获取配置地址(返回sourceType和验证地址)Srting----
uploaderauthUrl上传验证地址Srting----

Methods

事件名称说明回调参数
on-uploaded上传成功触发当前上传成功图片数组
on-draggable拖拽完成触发排序之后的数组

上传成功之后返回的图片数组字段 :tada:

{
    auth: ""//加密值
    ext: ""//文件类型
    file: File
    height: ''//图片高度
    md5: ""//加密MD5
    name: ""//图片名称
    path: ""//图传上传地址
    size: ''//图片大小
    status: ""//图片状态
    width: ''//图片宽度
}
1.0.17

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago