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就能加到組件里面了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM