作者在 2022-03-09 10:48:29 发布以下内容
这里有三个组件index.vue/Header.vue/Buttom.vue,现在要把Header.vue和Buttom.vue一同包含在index.vue
目录关系:
first
--components
--Header.vue
--Buttom.vue
--index.vue
下面是index.vue
<template>
<div id="first">
<myHeader ref="myHeader" />
<!-- <myContent ref="myContent" />-->
<!-- <myButton ref="myButton" />-->
</div>
</template>
<script>
import Header from './components/Header.vue'
import Content from './components/Content.vue'
import Button from './components/Buttom.vue'
export default {
name: 'first',
components: {
'myHeader': Header,
'myContent': Content,
'myButton': Button
},
}
</script>
Header.vue
<template>
<div>
Header.vue 组件
</div>
</template>
Buttom.vue
<template>
<div>
Header.vue 组件
</div>
</template>