Last active
November 2, 2015 21:04
-
-
Save yyx990803/34a0df7ad9f6ab5d7c7d to your computer and use it in GitHub Desktop.
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
// 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> | |
` | |
} |
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
// 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