because the echo is always done with true or false before, but the data returned by the backend this time is operated according to id. First, all the checkbook data is obtained by the display, and then the echo is done according to the id according to the data returned by the background. Here is the printed corresponding id
html
<ul class="section_ul clearfix">
<li v-for="item in roleList" :key="item.id">
<input type="checkbox">
<label>{{ item.name }}</label>
</li>
</ul>
js
roles(index, row) {
this.assignRoles = true;
// checkboxlist
this.$ajax.get(this.$api.roleList).then(res => {
if(res.data.status == 200) {
this.roleList = res.data.data.roleList;
this.id = this.rowData[0].id;
//
this.$ajax.get(this.$api.roleUser + this.id).then(res => {
console.log("11111", res);
this.userRoleList = res.data.data.userRoleList;
})
}
})
.catch(err => {
console.log("roles", err);
})
},