/* 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下的 任意一个组件 

Taro覆盖iview样式

组件内都留着扩展

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

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

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

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
猜你喜欢
  • 2021-07-08
  • 2021-08-12
  • 2021-10-07
  • 2022-12-23
  • 2022-01-19
  • 2021-11-04
  • 2022-01-30
相关资源
相似解决方案