@creatorqsf/yield
v1.0.6
Published
`yield` is a complement patch for `Riot.js v4` which lacks some of the features implemented with `<yield />` in `Riot.js v3`.
Downloads
6
Maintainers
Readme
pkg yield
yield
is a complement patch for Riot.js v4
which lacks some of the features implemented with <yield />
in Riot.js v3
.
Installation
For npm user,
$ npm install @creatorqsf/yield
For yarn user,
$ yarn add @creatorqsf/yield
Usage
In your bundle file (like app.js
) which register riot component or mount them, add some following lines.
import yf from '@creatorqsf/yield'
riot.install(yf)
Then in your component file (like my-tag.riot
), write <yield />
whereever you want it.
<my-tag>
<some-tag-even-nested>
<yield />
</some-tag-even-nested>
</my-tag>
A simple nested example is in _example/nested
directly. You can play with it by $ ./run.sh
.
Motivation and Issues of Riot v4
See these two issues:
Riot v4 inserts elements which exists in pre-mounted element without · Issue #2773 · riot/riot
Riot v4 inserts the elements not in · Issue #2774 · riot/riot
Author
License
MIT