sadais-piui 1.2.7-beta160 → 1.2.7-beta161
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"
|
|
@@ -447,6 +447,13 @@ export default {
|
|
|
447
447
|
return uploadImg.customPreviewImage
|
|
448
448
|
}
|
|
449
449
|
},
|
|
450
|
+
// 是否禁止preview预览
|
|
451
|
+
disablePreview: {
|
|
452
|
+
type: Boolean,
|
|
453
|
+
default() {
|
|
454
|
+
return uploadImg.disablePreview
|
|
455
|
+
}
|
|
456
|
+
},
|
|
450
457
|
},
|
|
451
458
|
data() {
|
|
452
459
|
return {
|
|
@@ -689,6 +696,7 @@ export default {
|
|
|
689
696
|
this.handleEmitChange()
|
|
690
697
|
},
|
|
691
698
|
handlePreview(img) {
|
|
699
|
+
if (this.disablePreview) return
|
|
692
700
|
const file = this.imgField ? img[this.imgField] : img
|
|
693
701
|
if (isImageFilename(file)) {
|
|
694
702
|
this.handlePreviewImage(file)
|
package/config/uploadImg.js
CHANGED
|
@@ -65,7 +65,7 @@ export default {
|
|
|
65
65
|
camera: 'back', // 前置或后置摄像头,默认back
|
|
66
66
|
extension: [] // 允许上传的文件类型,不填则不限制
|
|
67
67
|
},
|
|
68
|
-
parseResultFn: function(result) {
|
|
68
|
+
parseResultFn: function (result) {
|
|
69
69
|
try {
|
|
70
70
|
return JSON.parse(result.data)?.data.url
|
|
71
71
|
} catch (error) {
|
|
@@ -104,4 +104,5 @@ export default {
|
|
|
104
104
|
customUploadParams: {}, // 自定义上传参数,对象形式
|
|
105
105
|
fileLimit: null, // 文件大小限制,单位为字节,null表示不限制
|
|
106
106
|
customPreviewImage: false, // 是否自定义预览图片(如果为true,则不调用预览,通过事件自己实现预览)
|
|
107
|
+
disablePreview: false, // 是否禁止preview预览
|
|
107
108
|
}
|