sadais-piui 1.2.7-beta159 → 1.2.7-beta160

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -440,10 +440,12 @@ export default {
440
440
  return uploadImg.fileLimit
441
441
  }
442
442
  },
443
- // 上传成功解析对象方法
444
- customPreview: {
445
- type: [Function, null],
446
- default: null
443
+ // 是否自定义预览图片(如果为true,则不调用预览,通过事件自己实现预览)
444
+ customPreviewImage: {
445
+ type: Boolean,
446
+ default() {
447
+ return uploadImg.customPreviewImage
448
+ }
447
449
  },
448
450
  },
449
451
  data() {
@@ -728,8 +730,8 @@ export default {
728
730
  if (!this.previewFullImage) return
729
731
 
730
732
  // 自定义预览功能
731
- if (this.customPreview && this.$pi.lang.isFunction(this.customPreview)) {
732
- this.customPreview(img)
733
+ if (this.customPreviewImage) {
734
+ this.$emit('preview-image', img)
733
735
  return
734
736
  }
735
737
 
@@ -103,5 +103,5 @@ export default {
103
103
  fileIconMap: {}, // 文件类型和图标映射关系,对象形式({PDF: 'https://xxx'})
104
104
  customUploadParams: {}, // 自定义上传参数,对象形式
105
105
  fileLimit: null, // 文件大小限制,单位为字节,null表示不限制
106
- customPreview: null, // 自定义预览功能
106
+ customPreviewImage: false, // 是否自定义预览图片(如果为true,则不调用预览,通过事件自己实现预览)
107
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta159",
3
+ "version": "1.2.7-beta160",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {