vue how the introduction of sub-assemblies

The first step: examples are introduced in the subassembly sideFloating.vue aboutUs.vue screen, as
Here Insert Picture Description
a second step: to name a subassembly sideFloating.vue global id

<script type="text/ecmascript-6">
  export default {
    name:'indexFloating',
    }
</script>

Here Insert Picture Description
Third Step: Back Page aboutUs.vue, reference codes as in FIG subassembly sideFloating.vue

// 首先引入界面,indexFloating对应上一步的命名,然后渲染界面;
import indexFloating from '../../components/sideFloating/sideFloating.vue'
export default {
  name: 'aboutUs',
  components: {
    indexFloating
  }
}

Here Insert Picture Description
The fourth step, by introducing into the interface and rendering interface, you can call sideFloating.vue interface aboutUs.vue

<index-floating></index-floating>

Corresponds indexFloating uppercase to lowercase, the connections with a - Link

The fifth step, run the project, open the page display, sub-assemblies successfully introduced

Published 55 original articles · won praise 6 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_37916164/article/details/103496648