Skip to content

Recursive component broken with inherit: true since v0.12.2 #1012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jiangfengming opened this issue Jul 6, 2015 · 0 comments
Closed

Recursive component broken with inherit: true since v0.12.2 #1012

jiangfengming opened this issue Jul 6, 2015 · 0 comments

Comments

@jiangfengming
Copy link

Since 0.12.2, my recursive tree list component has been broken. Here is the minimal example:

<!DOCTYPE html>
<html>
<body>
  <div class="foo">
    <x-tree items="{{nav}}"></x-tree>
  </div>

  <script type="text/html" id="x-tree-template">
    <ul>
      <li v-repeat="item: items">
        {{item.text}}
        <x-tree v-if="item.children" items="{{item.children}}"></x-tree>
      </li>
    </ul>
  </script>

  <script src="node_modules/vue/dist/vue.js"></script>
  <script>
    Vue.config.debug = true;

    var foo = new Vue({
      el: '.foo',

      data: {
        nav: [
          { text: 'foo' },
          { text: 'bar' },
          { text: 'baz', children: [
            { text: 'baz-1' },
            { text: 'baz-2' }
          ] }
        ]
      },

      components: {
        'x-tree': {
          inherit: true,
          template: document.getElementById('x-tree-template').innerHTML,
          props: ['items']
        }
      }
    });
  </script>
</body>
</html>

It's OK without inherit: true:

  • foo
  • bar
  • baz
    • baz-1
    • baz-2

But with inherit: true, it ouputs:

  • baz-1
  • baz-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant