Skip to content

Instantly share code, notes, and snippets.

@yyx990803
Last active November 2, 2015 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yyx990803/34a0df7ad9f6ab5d7c7d to your computer and use it in GitHub Desktop.
Save yyx990803/34a0df7ad9f6ab5d7c7d to your computer and use it in GitHub Desktop.
// App.js
// using .jsx extension because gist syntax
// highlighting chokes on `export default`
import ComponentA from './ComponentA'
export default {
// use another component, in this scope only.
// ComponentA maps to the tag <component-a>
components: { ComponentA },
template: `
<div>
<p>Now I'm using another component.</p>
<component-a></component-a>
</div>
`
}
// ComponentA.js
export default {
template: '<div>{{message}}</div>',
data () {
return {
message: 'Hello!'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment