title: Check/Uncheck all checkbox in group Vue.js
body: <p>I have an Array of checkbox which already divided in to groups and I need to check all child checkbox if parent is checked and uncheck if parent is uncheck and then update all their state in Array. This wayyy over my head since I'm realy new to Vue.</p>
  
  <p>I setup a Codepen <a href="https://codepen.io/khanhvdv/pen/NwOmPz" rel="nofollow noreferrer">here</a>, and I can't change Array's structure since it's a JSON response from server.</p>
  
  <p>Js</p>
  
  <pre><code>let tree = [
      {
          "text": "AccountController",
          "id": 1,
          "state": {
              "opened": false,
              "selected": true,
              "disabled": false
          },
          "children": [
              {
                  "text": "Index",
                  "id": 2,
                  "state": {
                      "opened": false,
                      "selected": true,
                      "disabled": false
                  },
                  "children": null
              },
              {
                  "text": "Login",
                  "id": 3,
                  "state": {
                      "opened": false,
                      "selected": true,
                      "disabled": false
                  },
                  "children": null
              },
        ...
          ]
      },
      {
          "text": "BaseController",
          "id": 19,
          "state": {
              "opened": false,
              "selected": true,
              "disabled": false
          },
          "children": [
              {
                  "text": "GetErrorListFromModelState",
                  "id": 20,
                  "state": {
                      "opened": false,
                      "selected": true,
                      "disabled": false
                  },
                  "children": null
              },
              {
                  "text": "GetErrorFromModelState",
                  "id": 21,
                  "state": {
                      "opened": false,
                      "selected": true,
                      "disabled": false
                  },
                  "children": null
              },
        ...
          ]
      }
  ]
  let app = new Vue({
      el : '#clone',
      data : {
          items : tree,
  
      },
      methods : {
          submitForm() {
              console.log(tree);
          }
      }
  });
  </code></pre>
  
  <p>Html</p>
  
  <pre><code>&lt;div id="clone"&gt;
      &lt;button @click="submitForm"&gt;click&lt;/button&gt;
      &lt;div class="dd"&gt;
          &lt;ol class="dd-list"&gt;
              &lt;li v-for="(item, index) in items" 
                  v-bind:class="[item.state.opened ? 'dd-item open' : 'dd-item']"&gt;
                  &lt;div class="dd-handle"
                       @click="item.state.opened = !item.state.opened"&gt;
                      &lt;input type="checkbox"
                             :disabled="item.state.disabled" 
                             :name="item.text" 
                             :checked="item.state.selected" 
                             @click="item.state.selected = !item.state.selected"&gt;
                      &lt;label :for="item.text"&gt;{{item.text}}&lt;/label&gt;
                  &lt;/div&gt;
  
                  &lt;ol v-if="item.children.length != 0" class="dd-list"&gt;
                      &lt;li v-for="(children, index) in item.children" 
                          :data-id="children.id" class="dd-item"&gt;
                          &lt;div class="dd-handle"&gt;
                              &lt;input type="checkbox" 
                                     :name="children.text" 
                                     :checked="children.state.selected" 
                                     :disabled="children.state.disabled" 
                                     @click="children.state.selected = !children.state.selected"&gt;
                              &lt;label :for="children.text"&gt;{{children.text}}&lt;/label&gt;
                          &lt;/div&gt;
                      &lt;/li&gt;
                  &lt;/ol&gt;
              &lt;/li&gt;
          &lt;/ol&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Can someone enlighten me please. Thank in advance!</p>