I've been trying to get a dynamic component to work that will allow me to render list items individually based on a provided template.
It seems however, that Vue is interpolating the template in the parents scope and not within the dynamicComponent scope.
Simple example:
<dynamicComponent
v-for="item in listItems"
v-bind:input="item"
v-bind:is="{template:'<p>{{input.name}}</p>'}"
</dynamicComponent>
This fails since input is not known in the parents scope.
Is there a way to pass a template dynamically and have it reference variables/properties within the components scope?
Edit: Solution
Turns out I misunderstood the workings of v-bind:is a bit.
It allows you to inline bind/create an anonymous component, not add to/manipulate a referenced component.
The correct solution seems to be:
<component
v-for="item in listItems"
v-bind:input="item"
v-bind:is="{template:'<p>{{input.name}}</p>', props:['input']}">
</component>