时间:2021-03-19 09:45:27 | 栏目:vue | 点击:次
1.Vue隐藏显示
<div style="padding-top:5px;" v-bind:class="{hidden: isHidden }"> <label class="inline"> <input id="id-button-borders" checked="" v-model="user.userstate" type="checkbox" class="ace ace-switch ace-switch-5" /> <span class="lbl"></span> </label> </div> data:{ isHidden: true }
•v-bind:class=”{hidden: isHidden }” 可动态设置vm.isHidden值
•:class=”{hidden: isHidden }” 简写
2.Vue控件只读
<input type="text" class="form-control" v-bind:readonly="isReadOnly" validate="notNull,realname" v-model="user.realname"/>1 data:{ isReadOnly:false }
•v-bind:readonly=”isReadOnly” 可动态设置vm.isReadOnly
总结