动态属性值:
$("dd [type='checkbox']").change(function () {
var cname = $(this).prop("name");
$("[name="+cname+"]").prop("checked",$(this).prop("checked"));
});
$(".auth_rules").each(function () {
if($.inArray($(this).attr("value").substring(0,$(this).attr("value").length-1),arr)>-1) {
$(this).prop('checked',true);
}
})
和v-for 中嵌套v-for:
<dl v-for="value in options">
<dt>
<input type="checkbox" value="{{value.id}}," class="auth_rules">{{ value.title }}
</dt>
<dd v-for="dd in value.list">
<input type="checkbox" name="{{ dd.id }}" value="{{dd.id}}," class="auth_rules">{{ dd.title }}
</dd>
</dl>