Home  >  Q&A  >  body text

How vue.js renders components recursively.

I first wrote a basic component, and then I wanted to introduce myself into the component for recursive rendering. However, after introducing it, I would get the problem of template or render function not defined. I would like to ask for advice on how to solve it?

淡淡烟草味淡淡烟草味2663 days ago1302

reply all(2)I'll reply

  • 黄舟

    黄舟2017-07-05 11:01:35

    Specify a name field to the component

    var test = Vue.extend({
      name: 'test',
      template:
        '<p>' +
          // 递归地调用它自己
          '<test></test>' +
        '</p>'
    })

    reply
    0
  • 欧阳克

    欧阳克2017-07-05 11:01:35

    Introducing yourself, are you sure it won’t lead to an endless loop?

    reply
    0
  • Cancelreply