Vue3组件(SFC)拼接页面

编辑Head.vue

编辑Navigator.vue

编辑content.vue

clike 复制代码
<script setup>

</script>

<template>

<div>
    
    欢迎:xxx <a href="#">退出登录</a>
    
    
</div>

</template>

<style scoped>

</style>
clike 复制代码
<script setup>
</script>
<template>
<div>
    <ul>
        <li>学院管理</li>
        <li>图书管理</li>
        <li>请假管理</li>
        <li>考试管理</li>
        <li>班级管理</li>
        <li>教师管理</li>
    </ul>
</div>

</template>

<style scoped>

</style>
clike 复制代码
<script setup>

</script>

<template>

<div>
    这里是主要内容
</div>
</template>

<style scoped>

</style>

App.vue中引入这三个组件

clike 复制代码
<script setup>
import Header from './components/Head.vue'
import Navigator from './components/Navigator.vue'
import Content from './components/content.vue'
</script>
<template>
<div>
<Header id="header"></Header>
<Navigator class="navigator"></Navigator>
<Content id="content"></Content>
</div>
</template>
<style scoped>
    #header{
        height: 80px;
        border: 1px solid red;
    }
    .navigator{
        width: 15%;
        height: 800px;
        border: 1px solid green;
        float: left;
    }
    #content{
        width: 83%;
        height: 800px;
        border: 1px solid blue;
        float: right;
    }
</style>
相关推荐
QQ1__8115175152 小时前
Spring boot名城小区物业管理系统信息管理系统源码-SpringBoot后端+Vue前端+MySQL【可直接运行】
前端·vue.js·spring boot
钛态2 小时前
前端微前端架构:大项目的救命稻草还是自找麻烦?
前端·vue·react·web
一粒黑子2 小时前
【实战解析】阿里开源 PageAgent:纯前端 GUI Agent,一行JS让网页支持自然语言操控
前端·javascript·开源
独角鲸网络安全实验室2 小时前
2026微信小程序抓包全解析:从实操落地到合规风控,解锁前端调试新范式
前端·微信小程序·小程序·抓包·系统代理绕过·https证书严格校验·进程隔离
紫微AI2 小时前
前端文本测量成了卡死一切创新的最后瓶颈,pretext实现突破了
前端·人工智能·typescript
GISer_Jing2 小时前
AI前端(From豆包)
前端·aigc·ai编程
IT枫斗者2 小时前
前端部署后如何判断“页面是不是最新”?一套可落地的版本检测方案(适配 Vite/Vue/React/任意 SPA)
前端·javascript·vue.js·react.js·架构·bug
测试修炼手册2 小时前
[测试技术] 深入理解 JSON Web Token (JWT)
前端·json
AI老李2 小时前
2026 年 Web 前端开发的 8 个趋势!
前端
里欧跑得慢2 小时前
15. Web可访问性最佳实践:让每个用户都能平等访问
前端·css·flutter·web