自定义组件内如何修改radio样式
发布于 5 年前 作者 mengqiang 6379 次浏览 来自 问答

在自定义组件中修改radio的选中及默认状态下的样式失败,但是如果在 page 界面内修改却正常,请问如何在自定义组件内修改radio的样式

样式代码:

radio .wx-radio-input {

  margin-right: 15rpx ;

  position: absolute;

  width: 100%;

  height: 100%;

  top: 0;

  left: 0;

  background: none;

  border-radius: 6rpx;

  box-sizing: border-box;

}

radio .wx-radio-input.wx-radio-input-checked {

  background-color: transparent;

  border-color: #2cc078;

  overflow: hidden;

  box-sizing: border-box;

}

radio .wx-radio-input.wx-radio-input-checked::before {

  content: url(http://www.lutao.com/front/images2014/common/tick.svg);

  background-size: 20rpx 20rpx;

  font-family: “iconfont” !important;

  font-size: 10rpx;

  color: #2cc078;

  top: auto;

  left: auto;

  right: -4rpx;

  bottom: -4rpx;

  transform: translate(0, 0) scale(1);

  -webkit-transform: translate(0, 0) scale(1);

}

1 回复

都自定义组件了,还改啥样式,自己写一个,

回到顶部