sadais-piui 1.2.7-beta158 → 1.2.7-beta159

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.
@@ -6,7 +6,7 @@
6
6
  * @Description: 图片上传组件
7
7
  * @FilePath: \piui\components\pi-upload-img\index.vue
8
8
  -->
9
-
9
+
10
10
  <template>
11
11
  <view
12
12
  class="pi-upload-img"
@@ -439,7 +439,12 @@ export default {
439
439
  default() {
440
440
  return uploadImg.fileLimit
441
441
  }
442
- }
442
+ },
443
+ // 上传成功解析对象方法
444
+ customPreview: {
445
+ type: [Function, null],
446
+ default: null
447
+ },
443
448
  },
444
449
  data() {
445
450
  return {
@@ -721,6 +726,13 @@ export default {
721
726
  // 预览图片
722
727
  handlePreviewImage(img) {
723
728
  if (!this.previewFullImage) return
729
+
730
+ // 自定义预览功能
731
+ if (this.customPreview && this.$pi.lang.isFunction(this.customPreview)) {
732
+ this.customPreview(img)
733
+ return
734
+ }
735
+
724
736
  let urls = []
725
737
  let current = ''
726
738
 
@@ -102,5 +102,6 @@ export default {
102
102
  customTakePhoto: false, // 是否自定义拍照(如果为true,则不调用相机,通过事件自己实现拍照上传)
103
103
  fileIconMap: {}, // 文件类型和图标映射关系,对象形式({PDF: 'https://xxx'})
104
104
  customUploadParams: {}, // 自定义上传参数,对象形式
105
- fileLimit: null // 文件大小限制,单位为字节,null表示不限制
105
+ fileLimit: null, // 文件大小限制,单位为字节,null表示不限制
106
+ customPreview: null, // 自定义预览功能
106
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta158",
3
+ "version": "1.2.7-beta159",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {