1.0.7 • Published 11 months ago

badi-npm-uploadimg v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

下载npm包

npm i badi-npm-uploadimg

全局导入

import upLoadImg from 'badi-npm-uploadimg'
Vue.use(upLoadImg)

组件使用

  <upLoadImg
    :limit="5"
    :legalType="[
      'image/jpeg',
      'image/jpg',
      'image/png',
      'image/webp',
      'image/bmp',
      'image/svg'
    ]"
    :fixedNumber="[750, 500]"
    :errorMsg="'格式错误提示'"
    @uploadSuccess="OnUploadSuccess"
  />

Attribute

参数说明类型默认值
limit图片数量限制number10
legalType图片格式限制array'image/jpeg','image/jpg','image/png'
fixedNumber图片尺寸比例array750, 500
errorMsg格式错误提示自定义文字string——

Event

事件名说明回调参数
uploadSuccess选择成功回调imgInfoList

方法和返回格式

function OnUploadSuccess(imgInfoList) {}
imgInfoList = [{
  fileName: 'xxxx.xxx',
  filePath: 'data:image/xxx;base64,XXXX',
}
···
]
1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago