美文网首页
【V4】组件开发

【V4】组件开发

作者: 赵羽珩 | 来源:发表于2019-11-11 10:46 被阅读0次
    image.png

    Home.vue将要引入组件 HomeHeader.vue(组件)

    <template>
      <div>
        <home-header></home-header>
        <router-link to="/city">城市列表</router-link>
      </div>
    </template>
    
    <script>
    import HomeHeader from './components/HomeHeader'
    export default {
      name: 'Home',
      components: {
        HomeHeader
      }
    }
    </script>
    
    <!-- Add "scoped" attribute to limit CSS to this component only -->
    <style>
    
    </style>
    
    

    HomeHeader.vue

    <template>
      <div>
        公共导航栏
      </div>
    </template>
    
    <script>
    export default {
      name: 'HomeHeader'
    }
    </script>
    
    <!-- Add "scoped" attribute to limit CSS to this component only -->
    <style>
    
    </style>
    
    

    相关文章

      网友评论

          本文标题:【V4】组件开发

          本文链接:https://www.haomeiwen.com/subject/iaogbctx.html