vue 绑定style,class
vue 绑定style
:style="{'padding-left':index==0?'22px':''}
1 <label v-for="(item,keyName,index) in ENUM.transportType" :style="{'padding-left':index==0?'22px':''}"> 2 <input type="radio" name="transportRadioGroup" :value="item.key">{{keyName}} 3 </label>
vue绑定class
:class="{'btn-primary':xxxx==item.key}"
或者:class="{'fas fa-bookmark':xxx==index,'far fa-bookmark':xxx!=index}"
<button name="yeWuBtn" class="btn" :class="{'btn-primary':boJob.jobType==item.key}" type="button" @click="openBusinessLeft(item.key,ENUM.getValue(ENUM.jobType,item.key),index,'jobType'+index,$event)">{{ENUM.getValue(ENUM.jobType,item.key)}}</button>
欢迎转载,请注明出处