Forked from jacobwyke/multiple-nodes-vuejs-component.js
Created
December 17, 2018 08:01
-
-
Save yelodevopsi/3f570aaa26d7781995351297f74d268e to your computer and use it in GitHub Desktop.
Vue.js render function template component with multiple child nodes
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
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