美文网首页
taro 微信小程序button样式

taro 微信小程序button样式

作者: MasterPaul | 来源:发表于2021-01-13 14:46 被阅读0次

微信小程序的button有一些默认的样式,修改起来比较麻烦,我的思路是去掉button的边框和背景颜色,覆盖在自己写的view上面,加一个绝对定位就可以了。
比如下图客服中心按钮,是打开客服会话,需要用到button


截屏2021-01-13 下午2.43.42.png

代码如下

<View className={'item'} style={{position:'relative'}}>
            <Image src={Images.service} className={'image'} mode={'aspectFit'}/>
            <View className={'title'}>客服中心</View>

            <Button  openType={'contact'} size={'mini'} type={'default'}
                     style={{position:'absolute',backgroundColor:'transparent',border:'none',
paddingLeft:0,paddingRight:0,top:0,left:0,right:0,bottom:0
                     }}
                     plain={true}
            />
          </View>

相关文章

网友评论

      本文标题:taro 微信小程序button样式

      本文链接:https://www.haomeiwen.com/subject/cliuaktx.html