相思资源网 Design By www.200059.com
js:
$(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);
}
})
})
});
});
});
html:
<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取不到属性值的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
标签:
vue,attr,属性值
相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com
暂无解决vue attr取不到属性值的问题的评论...