Skip to content

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

Closed
@jiangfengming

Description

@jiangfengming

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions