关于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>
 

 

 

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