Taro覆盖iview样式

/* CustomComp.js */
export default CustomComp extends Component {
  static options = {
    addGlobalClass: true
  }

  render () {
    return <View className="red-text">这段文本的颜色由组件外的 class 决定</View>
  }
}
/* 组件外的样式定义 */
.red-text {
  color: red;
}

上面只能覆盖 taro-ui的样式

打开iview下的 任意一个组件 

组件内都留着扩展

大部分默认的是  i-class进行传入

有的组件会有多的结构,还会有别的扩展

<i-cell i-class='test' title="常见问题" is-link></i-cell>

这样 test就能加到组件里面了

猜你喜欢

转载自www.cnblogs.com/anxiaoyu/p/10272583.html
今日推荐