These are chat archives for riot/riot

10th
Dec 2016
Richard Tallent
@richardtallent
Dec 10 2016 16:09
So... two things I can't seem to get working, hoping someone has advice: (1) nested virtual tags, and (2) logic for switching between subcomponent types. When nesting virtual tags, the inner virtuals are being added to the DOM. For (2), I need to switch between checkbox, date, text, textarea, select, etc. depending on the intended field type. I'm guessing I need individual components for each of these, but switching among them seems a bit clunky using "if", and I'm not sure how the "item" loop variable gets passed to the subcomponent instance.
Cris Ward
@crisward
Dec 10 2016 17:46
@richardtallent checkout out data-is for switching components. http://riotjs.com/guide/ this can be dynamic. ie
<div data-is="{tagname}"></div>
<script>this.tagname="dropdown"</script>