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

Using v-runtime-template within a slot #63

Open darylteo opened 4 years ago

darylteo commented 4 years ago

Just documenting this here as it took me awhile to solve this as it was not documented. Solved by code inspection.

If you want to pass some other props into the v-runtime-template's component, you can use

data: () => ({
    template: `<div>{{parentProp1}} {{prop}}</div>`,
}),
<v-runtime-template :template="template" :templateProps="{parentProp1, prop: parentProp2}"></v-runtime-template>

This seems to be required if you

Hope this saves people some time in the future.