Skip to content

Commit fb75dae

Browse files
author
shixing.peng
committed
feat: 支持自定义上传按钮
1 parent 3364a36 commit fb75dae

File tree

1 file changed

+9
-8
lines changed
  • packages/taro-ui/src/components/image-picker

1 file changed

+9
-8
lines changed

packages/taro-ui/src/components/image-picker/index.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,15 @@ export default class AtImagePicker extends React.Component<AtImagePickerProps> {
137137
key={'empty_' + i * length + j}
138138
>
139139
{item.type === 'btn' && (
140-
<View
141-
className='at-image-picker__item at-image-picker__choose-btn'
142-
onClick={this.chooseFile}
143-
>
144-
<View className='add-bar'></View>
145-
<View className='add-bar'></View>
146-
</View>
147-
)}
140+
<View onClick={this.chooseFile}>
141+
{
142+
this.props.children
143+
|| <View className='at-image-picker__item at-image-picker__choose-btn'>
144+
<View className='add-bar'></View>
145+
<View className='add-bar'></View>
146+
</View>
147+
}
148+
</View>)}
148149
</View>
149150
)
150151
)}

0 commit comments

Comments
 (0)