Vue父子组件案例

版权声明:本文为博主原创文章,转载请标记出处。 http://blog.csdn.net/qq_41247433 https://blog.csdn.net/qq_41247433/article/details/79975380
<template>
  <div id="app">
    <p>aaaa</p>
    <img src="./assets/logo.png">
    <router-view/>
    <p>aaaa</p>
    <header-vue/>
    <body-vue/>
    <footer-vue/>
  </div>

</template>

<script>

  import headerVue from './components/Head.vue'
  import bodyVue from './components/body.vue'
  import footerVue from './components/footer.vue'

export default {
  name: 'App',
  components:{
    //在模板中使用 组件名:子组件对象
    headerVue:headerVue,
    bodyVue,
    footerVue
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页