亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

解決vue attr取不到屬性值的問題

 更新時(shí)間:2018年09月18日 10:24:18   作者:qq_17152035  
今天小編就為大家分享一篇解決vue attr取不到屬性值的問題,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧

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取不到屬性值的問題就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論