wxml代码:
<view>
<button class="publish" disabled="{{disabled}}" bindtap='submit'>发表</button>
</view>
css代码:
/* 去掉按钮边框方法一 */
.publish::after {
border: none;
}
/* 去掉按钮边框方法二 */
.publish::after {
border: 0;
}
设置透明按钮:
.publish{
width:100%;
margin: 0 auto;
display:block;
color: #CDB03B;
background: transparent; /*设置背景颜色一致*/
border-color: transparent; /*设置边框颜色一致*/
/* background-color: rgba(255,255,255,0); */
}
.publish::after{
border: none; /*设置边框取消*/
}
button 设置 disabled 之后背景颜色和字体颜色的值都是默认的 ,需要修改 disabled 背景颜色和字体颜色。
/* 修改默认背景色 */
.publish[disabled][type="default"], wx-button[disabled]:not([type]) {
color: #7f8389;
background-color: white;
border-color: white;
}