uniapp开发小程序uview的u-button样式自定义修改

u-button组件里:customStyle="样式数据名"

在data里申明样式数据名,形式为对象,注意值要加引号,且有-的只要改为驼峰命名如border-Radius
例如:
//html
<u-button :customStyle="btnGetCode"></u-button>
//js
data(){
  return {
    btnGetCode: {
          borderRadius: '7px',//驼峰命名注意----这里如果不规范,会整体失效,px,rpx作为单位都可以,一定要有引号
          height: '34px', 
    }
  }
}
posted @ 2023-05-13 22:01  盘思动  阅读(1917)  评论(0编辑  收藏  举报