alexjoverm / v-runtime-template

Vue component for compiling templates on the fly using a v-html like API
MIT License
605 stars 70 forks source link

Feature Request: Pass props to the template #22

Closed Pyro979 closed 5 years ago

Pyro979 commented 5 years ago

It'd be nice if we can pass specific props to the template - for example if you're looping through an object and each object needs to be passed in.

Since we can't just pass arbitrary props to the component, I'm proposing we pass in an object with the props, which then merges with the parent's data & props to be passed to the template.

Example:

<div v-for="person in people" :key="person.id">
  <v-runtime-template :template="fancy_name" :template_props="{name: person.name, id: person.id}"/>
</div>
alexjoverm commented 5 years ago

Fixed by 1.9.0