Browse Source

自定义预览大小

guhongwei 3 năm trước cách đây
mục cha
commit
ff11c9925a
3 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 2 1
      commpents/upload/index.js
  2. 1 1
      commpents/upload/index.wxml
  3. 1 0
      commpents/upload/read.md

+ 2 - 1
commpents/upload/index.js

@@ -7,7 +7,8 @@ Component({
   options: { multipleSlots: true },
   properties: {
     list: { type: 'array', value: [] },
-    count: { type: Number, value: 1 }
+    count: { type: Number, value: 1 },
+    previewSize: { type: String, value: '60' }
   },
 
   // 生命周期函数,可以为函数,或一个在methods段中定义的方法名

+ 1 - 1
commpents/upload/index.wxml

@@ -1 +1 @@
-<van-uploader file-list="{{list}}" max-count="{{count}}" bind:after-read="imgUpload" bind:delete="imgDel" />
+<van-uploader file-list="{{list}}" max-count="{{count}}" bind:after-read="imgUpload" bind:delete="imgDel" preview-size="{{previewSize}}" />

+ 1 - 0
commpents/upload/read.md

@@ -2,6 +2,7 @@
 ## 参数
 ### 图片存储列表:list
 ### 图片上传数量限制:count
+### 自定义预览大小:previewSize
 
 ## 方法
 ### 上传图片---imgUpload