title: Recursive method in VueJS
body: <p>I'm creating a recursive method in Nuxt, can I do it?</p>
  <p>Here is my component:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script&gt;
  export default {
    data() {
      return {
        items: [],
        auxitems: [],
      }
    },
    methods: {
      orderRecursive(items, auxitems) {
        items.data.forEach((element) =&gt; {
          auxitems.push(element)
        })
        if (items.child.length &gt; 0) {
          this.orderRecursive(items.child, auxitems)
        } else {
          //
        }
      },
    },
  }
  &lt;/script&gt;
  </code></pre>
  <p>The struct items is like:</p>
  <pre><code>items= [
    data: [{array}],
    child: [{data, child}]
  ]
  </code></pre>
  <p>My intention is order all data in one array, then, I can show in view.<br />
  My method <code>orderRecursive()</code> is not working, can you tell me why?</p>