關於uni-app h-builderx 的學習

1,關於css,樣式相關的

<!-- 單類格式的 -->

<view :class="{ active: isActive }">111</view>

<!-- 關於對象的 -->

<view class="static" v-bind:class="{ active: isActive, 'text-danger': hasError }">222</view

<!-- 數組格式的 -->

<view class="static" :class="[activeClass, errorClass]">333</view>

<!-- 條件寫法的 -->

<view class="static" v-bind:class="[isActive ? activeClass : '', errorClass]">444</view>

<!-- 數組+對象格式的 -->

<view class="static" v-bind:class="[{ active: isActive }, errorClass]">555</view>

<!-- 執行格式的 -->

<view class="container" :class="computedClassStr"></view>
<view class="container" :class="{activeGrey: isActive}">9999</view>

2,關於style樣式的

<view v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }">666</view>
<view v-bind:style="[{ color: activeColor, fontSize: fontSize + 'px' }]">777</view>
 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章