File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed
taro-ui/src/components/image-picker Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,21 @@ export default class Index extends Taro.Component {
110
110
111
111
:::
112
112
113
+ ## 自定义上传按钮
114
+
115
+ ::: demo
116
+
117
+ ``` jsx
118
+ < AtImagePicker
119
+ files= {this .state .files }
120
+ onChange= {this .onChange .bind (this )}
121
+ >
122
+ < AtButton type= " primary" > 自定义上传按钮< / AtButton>
123
+ < / AtImagePicker>
124
+ ```
125
+
126
+ :::
127
+
113
128
## 多种图片预览模式
114
129
115
130
::: demo
Original file line number Diff line number Diff line change @@ -139,14 +139,15 @@ export default class AtImagePicker extends React.Component<AtImagePickerProps> {
139
139
key = { `empty_${ i * length } ${ j } ` }
140
140
>
141
141
{ item . type === 'btn' && (
142
- < View
143
- className = 'at-image-picker__item at-image-picker__choose-btn'
144
- onClick = { this . chooseFile }
145
- >
146
- < View className = 'add-bar' > </ View >
147
- < View className = 'add-bar' > </ View >
148
- </ View >
149
- ) }
142
+ < View onClick = { this . chooseFile } >
143
+ {
144
+ this . props . children
145
+ || < View className = 'at-image-picker__item at-image-picker__choose-btn' >
146
+ < View className = 'add-bar' > </ View >
147
+ < View className = 'add-bar' > </ View >
148
+ </ View >
149
+ }
150
+ </ View > ) }
150
151
</ View >
151
152
)
152
153
) }
You can’t perform that action at this time.
0 commit comments