Skip to content

Instantly share code, notes, and snippets.

@panayotoff
Last active May 14, 2018 08:37
Show Gist options
  • Save panayotoff/d4a4822298b7eeb3000cf870399c6d22 to your computer and use it in GitHub Desktop.
Save panayotoff/d4a4822298b7eeb3000cf870399c6d22 to your computer and use it in GitHub Desktop.
Simple VueJS Dynamic component
export default {
name : 'Dynamo',
functional: true,
props : {
template: String
},
render(createElement, context)
{
context.parent.$once('hook:mounted', () => {
context.parent.$forceUpdate()
});
return createElement({
template: `<div class="dynamo">${context.props.template}</div>`
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment