项目使用vue.js+jquery; 不是纯前后端分离
html中:
<div class="form-group">
<div class="col-sm-2 control-label">角色</div>
<div class="col-sm-10 roleClass">
<label v-for="(role,index) in roleList" class="checkbox-inline">
<input type="checkbox" :value="role.id" v-model="user.roleIdList"
name="roleIdList">{{role.roleName}}
</label>
</div>
</div>
js中:
//获取角色列表
getRoleList: function(){
$.get(baseURL + "sys/role/select", function(r){
vm.roleList = r.data.list;
});
},
效果如下图: