title: precheck checkboxes depending on the response coming in json form in vuejs
body: <p>Sorry for my English. I am trying to pre select those checkboxes whos values have been saved in the database. I did it using javascript in vuejs but those selected checkboxes values are not storing in array.</p>
  
  <p>My code is like</p>
  
  <p>role.component.js</p>
  
  <pre><code>getRoleRowData(data) {
          this.roleaction = "edit";
          this.addrolemodal = true;
          console.log(data.role_id);
  
          axios
              .post(apiUrl.api_url + "getRolePermissionData", {
                  role_id: data.role_id
              }).then(
                  result =&gt; {
                      this.permid = result.data;
  
                      var list = [];
                      result.data.forEach(function(value) {
                          list.push(value.perm_id);
                      });
                      var options = list;
  
                      for (var i = 0; i &lt; options.length; i++) {
                          if (options[i]) document.querySelectorAll('input[value="' + options[i] + '"][type="checkbox"]')[0].checked = true;
                      }
                  },
                  error =&gt; {
                      console.error(error);
                  }
              );
          this.addrole = data;
      },
  </code></pre>
  
  <p>And role.component.html</p>
  
  <pre><code>&lt;div class="col-md-8"&gt;
                      &lt;b-form-fieldset&gt;
                         &lt;div class="form" id="demo"&gt;
                            &lt;h6&gt;Permissions&lt;/h6&gt;
                            &lt;span v-for="perm_name_obj in listPermissionData"&gt;
                            &lt;input type="checkbox" class="perm_id" v-bind:value="perm_name_obj.perm_id" name="perm_id" id="perm_name" v-model="checkedPerm_Id"&gt; {{perm_name_obj.perm_name}}&lt;br&gt;
                            &lt;/span&gt;
                            &lt;span&gt;Checked names: {{ checkedPerm_Id }}&lt;/span&gt;
                         &lt;/div&gt;
                      &lt;/b-form-fieldset&gt;
                   &lt;/div&gt;
  </code></pre>
  
  <p>And the Output</p>
  
  <p><a href="https://i.stack.imgur.com/bFBbi.png" rel="nofollow noreferrer">And the Ouput I got</a></p>
  
  <p>In simple words I want to pre check checkboxes in vuejs of which values are stored in database.</p>