子组件注册
- var myHeaderChild={
- template:'<P>I am a my header child</p>'
- }
- var myHeader={
- template:'<p><my-header-child></my-header-child></p>',
- components:{
- 'my-header-child':myHeaderChild
- }
- }
- new Vue({
- el:'#app',
- data:{
- word:'hello world'
- },
- components:{
- 'my-header':myHeader
- }
- })