Recursive template with knockout js

后端 未结 4 511
逝去的感伤
逝去的感伤 2020-12-09 02:03

Is it possible to create a recursive template only with knockout js?

I have a knockout object:

function FormElementNode(children, text, value) {
   v         


        
4条回答
  •  醉酒成梦
    2020-12-09 02:31

    Yes KnockOut supports recursive templates so you can reference and render the same template inside the template.

    An example html in your case would look like this:

        
    
    

    Demo JSFiddle.

提交回复
热议问题