You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.3 KiB

3 months ago
  1. ### easy-upload 组件
  2. 使用方法
  3. ```js
  4. <easy-upload
  5. :dataList="imageList" uploadUrl="http://localhost:3000/upload" :types="category"
  6. deleteUrl='http://localhost:3000/upload' :uploadCount="6"
  7. @successImage="successImage" @successVideo="successvideo"
  8. ></easy-upload>
  9. //先引入组件
  10. import easyUpload from '@/components/easy-upload/easy-upload.vue'
  11. //注册组件
  12. components:{
  13. easyUpload
  14. }
  15. //使用 easycom 可以直接使用
  16. ```
  17. | 参数 | 类型 | 是否必填 | 参数描述
  18. | ---- | ---- | ---- | ----
  19. | types | String | 否 | 上传类型 image/video
  20. | dataList | Array | 否 | 图片/视频数据展示
  21. | clearIcon | String | 否 | 删除图标(可以换成自己本地图片)
  22. | uploadUrl | String | 否 | 上传的接口
  23. | deleteUrl | String | 否 | 删除的接口
  24. | uploadCount | Number | 否 | 上传图片最大个数(默认为一张)
  25. | upload_max | Number | 否 | 上传大小(默认为3M)
  26. | upload_max | Number | 否 | 上传大小(默认为3M)
  27. | upload_max | Number | 否 | 上传大小(默认为3M)
  28. | 事件 | 是否必填 | 参数描述
  29. | ---- | ---- | ----
  30. | successImage | 否 | 上传图片成功事件
  31. | successVideo | 否 | 上传视频成功回调
  32. 示例项目中有服务端代码 (node.js)