How vue.js renders components recursively.
淡淡烟草味
淡淡烟草味 2017-07-05 10:59:35
0
2
1328

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?

淡淡烟草味
淡淡烟草味

reply all(2)
黄舟

Specify a name field to the component

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

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template