vue导入组件
在项目目录src/components下分别新建.vue的header.vue和footer.vue文件
header.vue
<script setup>
</script>
<template>
<h3>header</h3>
</template>
<style scoped>
</style>
footer.vue
<script setup>
</script>
<template>
<h3>footer</h3>
</template>
<style scoped>
</style>
在app.vue中导入header.vue和footer.vue
<script setup>
import Header from "./components/header.vue"
import Footer from "./components/footer.vue"
</script>
<template>
<Header/>
<h3>hello word</h3>
<Footer/>
</template>
<style scoped>
</style>
评论已关闭