Last active
May 14, 2018 08:37
-
-
Save panayotoff/d4a4822298b7eeb3000cf870399c6d22 to your computer and use it in GitHub Desktop.
Simple VueJS Dynamic component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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