Based on the Vuejs documentation examples, I am trying to create a simple tree component where I can show the chart of accounts without any intervention (not adding any drag and drop ... really easy).
I made an example on FiddleJs, but my example works fine there ... I donβt know why in my application I can not get it to work! I don't know if these are some of Vueify's problems ... maybe you can help me!
There is my code:
OzChartTree.vue
<template> <ul v-if="model.length"> <li v-for="m in model" :class="{ 'is-group': m.children }"> {{ m.name }} <ul v-if="m.accounts"> <li v-for="a in m.accounts"> {{ a.name }} </li> </ul> <oz-tree :model="m"></oz-tree> </li> </ul> </template> <script type="text/babel"> import OzChartTree from './OzChartTree.vue' export default { components: { OzTree: OzChartTree }, props: { model: Array, } } </script>
When I call the tree component for the first time
<oz-chart-tree :model="chart"></oz-chart-tree>
The problem is that I call the component recursively in the ja.vue file.
As stated above, I got the following error:
app.js: 23536 [Vue warn]: Unknown user element: - Have you registered the component correctly? For recursive components, be sure to include a "name".
But correctly registered as OzTree! I do not understand!
Does anyone have an idea?
source share