这篇文章主要为大家详细介绍了解决vue attr取不到属性值的问题,具有一定的参考价值,可以用来参考一下。
感兴趣的小伙伴,下面一起跟随四海网的小编两巴掌来看看吧!
代码如下:
$(document).ready(function() {
$.get("/account/authGroupInfo",{id:groupId}, function(data) {
var arr = data.data.rules.split(",");
console.log(arr);
$.get("/account/allRule",{}, function(result) {
ruleList.options = result.data;
//问题所在
ruleList.$nextTick(function () {
$(".auth_rules").each(function () {
if($.inArray($(this).attr("id"),arr)>-1) {
$(this).prop('checked',true);
}
})
})
});
});
});
代码如下:
<tr v-for="value in options">
<td><input type="checkbox" id="{{value.id}}" value="{{value.id}}," class="auth_rules">{{ value.title }}</td>
</tr>
ruleList.$nextTick(function () {}) 拿到更新后的dom
以上这篇解决vue attr取不到属性值的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持四海网。
本文来自:http://www.q1010.com/184/6208-0.html
注:关于解决vue attr取不到属性值的问题的内容就先介绍到这里,更多相关文章的可以留意四海网的其他信息。
关键词:vue.js
四海网收集整理一些常用的php代码,JS代码,数据库mysql等技术文章。