解决vue attr取不到属性值的问题

今天小编就为大家分享一篇解决vue attr取不到属性值的问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

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" value="{{value.id}},">{{ value.title }}</td> </tr>

使用

ruleList.$nextTick(function () {}) 拿到更新后的dom

以上这篇解决vue attr取不到属性值的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/484fc8595fb492d30c05ab678b96f527.html