riot-tag as expression in loop #1368

Closed
marvinroger opened this Issue Nov 19, 2015 · 2 comments

Projects

None yet

4 participants

@marvinroger

Hi,

Given:

var nodes = [{ type: "customtag" }];

The following doesn't render the tag:

<div riot-tag="{ type }" each="{ nodes }"></div>

However, replacing manually the riot-tag with the name of the tag does work.

Am I doing something wrong?

@lloydzhou

you can try to call riot.mount() on "mount" event:

<div class="sub_class" riot-tag={ type } each={ nodes }>
this.on('mount', function(){
    riot.mount('.sub_class')
})
@marvinroger

Thanks, it works. But now, the problem is passing an object through attribute doesn't work. (e.g <div riot-tag="{ type }" each="{ nodes }" object={ object }></div>. I don't have access to opts.object from the tag. Again, replacing manually riot-tag with the name of the tag corrects the issue.

@rsbondi rsbondi self-assigned this Dec 19, 2015
@GianlucaGuarini GianlucaGuarini added this to the 3.0.0 milestone Jul 23, 2016
@rsbondi rsbondi removed their assignment Jul 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment