3

I'm trying to build an extended set of custom components for handling form elements. To start with I wanted to create a form-components custom tag, that handles showing of label (and later some basic validation rules) and then specific components.

In this fiddle you can see it set up. I'm using the nested tags example to copy nodes from the parent tag to the child tag. However, this only seems to work 1 deep.

I'm doubting wether my approach is the right way to go and this just isn't supported, or I'm just looking at it from the wrong direction.

Ideas anyone?

4

2 回答 2

2

我刚刚将您的小提琴更新为 riot.js v2.0.15 并用<inner-html/><yield/>标签替换了标签,它似乎可以工作。

小提琴:http: //jsfiddle.net/e3p9n4pd/

于 2015-05-02T18:29:55.153 回答
-1

如果我们试图在标签定义的 HTML 代码中访问标签的内部文本,“yield”标签很有用。但是如果我们必须在 scri 中访问该文本

于 2015-09-27T16:06:25.213 回答