Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yelodevopsi/3f570aaa26d7781995351297f74d268e to your computer and use it in GitHub Desktop.
Save yelodevopsi/3f570aaa26d7781995351297f74d268e to your computer and use it in GitHub Desktop.
Vue.js render function template component with multiple child nodes
Vue.component('greeting', {
//Renders:
//<div>
// <h1>Hello World!</h1>
// <p>Welcome to Vue.js</p>
// <p>A <a href="foo/bar.html">link</a> within a sentence.</p>
//</div>
render(createElement) {
return createElement(
'div',
[
createElement('h1', 'Hello World!'),
createElement('p', 'Welcome to Vue.js'),
createElement('p',
[
'A ',
createElement(
'a',
{
attrs: {
'href': 'foo/bar.html'
}
},
'link'
),
' within a sentence.'
]
),
]
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment