1. Demand
Click the button to call the mobile phone album to select pictures to upload
2. Solutions
Add openType="chooseAvatar" to Button; the writing method of onChooseAvatar must use button button, just change the style so that it is not visible.
3. Code
//解决方案
// 1、Button 上加 openType="chooseAvatar";
// 2、onChooseAvatar 写方法,必须用button 按钮,更改下样式看不出来就行。
<Button
className={`${styles.avatarBtn}`}
openType="chooseAvatar"
onChooseAvatar={(e) => { store.getAvatar(e) }}
>
<Image
src={store.infoDetail.avatar || ''}
mode="aspectFill"
className={`${styles.avatar}`}
/>
</Button>