Created
August 27, 2018 03:01
-
-
Save renoirb/65a7f7f62f5ebfaee8789875c40263b2 to your computer and use it in GitHub Desktop.
Vue component in a Gist
This file contains 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
// const render = Vue.compile('<h1>Hello {{what}}</h1>') | |
const HelloComponent = Vue.component('greet-component', {template: '<h1>Hello {{what}}</h1>', props: ['what']}) | |
const app = new Vue({template: '<div><greet-component :what="name" /></div>', components: { HelloComponent }, data: {name: 'World'}}) | |
app.$mount() | |
app.$children[0].$el.textContent // "Hello World" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment