vue页面标签如何根据条件添加属性?
vue页面标签如何根据条件添加属性?
解决方法:
1.当isReadyonly=='1'时添加disabled属性
<select class="form-control" name="in_out_type" v-model="tb_ship_report.in_out_type" :disabled="isReadyonly=='1'"> <option value="in">进港</option> <option value="out">出港</option>
</select>
2.当isReadyonly=='1'时添加class="form-control",当isReadyonly!='1'时class="form-control timer"
<input type="text" name="in_out_time" v-model="tb_ship_report.in_out_time"
v-bind:class="{'form-control':isReadyonly=='1','form-control timer':isReadyonly!='1'}" style="cursor: pointer;" readonly/>