Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a <yield> tag for transclusion #104

Open
nippur72 opened this issue Feb 17, 2016 · 0 comments
Open

Add a <yield> tag for transclusion #104

nippur72 opened this issue Feb 17, 2016 · 0 comments

Comments

@nippur72
Copy link
Contributor

To extend the concept introduced in #103 we could add a <yield> tag similar to that in Riot or Ember:

  • <yield to="name">...</yield> would pass the element tree in this.props.name
  • <yield from="name"/> would render the tree passed in this.props.name
  • <yield /> with no attributes would be simply a shortcut for this.props.children
  • <yield render="{this.someFunc()}"/> would render the tree returned from this.someFunc()

Some examples:

<my-splitter>
   <yield to="leftpanel"><div>hello</div></yield>
   <yield to="rightpanel"><div>hola</div></yield>
</my-splitter>

my-splitter.rt:

<tree>
   <yield from="leftpanel"/>
</tree>
<panel>
   <yield from="rightpanel"/>
</panel>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant