<div id="roles" class="layui-col-md3" style="width: 100%;">
<label>角色</label>
<input id="role1" type="checkbox" name="role1" title="超级管理员"value='1' v-model="checkedNames"/>
<input id="role2" type="checkbox" name="role2" title="普通用户" value="2" v-model="checkedNames"/>
<input id="role3" type="checkbox" name="role3" title="科室主任" value="3" v-model="checkedNames"/>
<input id="role6" type="checkbox" name="role4" title="测试1" value="6" v-model="checkedNames"/>
</div>
getInfo: function(userId) {
$.get(baseURL + 'command/commonrfkjuser/getRoleId?userId=' + userId, function(r) {
vm.checkedNames = r.data
Vue.nextTick(function() {
for (var i = 0; i < r.data.length; i++) {
$("#roles" + r.data[i]).attr("checked", "checked");
}
// this.$set("checkedNames")
this.checkedNames = r.data
console.log(this.checkedNames)
// DOM 更新了
})
});
this.$forceUpdate();
},
###r.data 数据是什么啊
然后都已经用vue了 这里咋还要用jq