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>
相关推荐
明月_清风16 小时前
自定义右键菜单:在项目里实现“选中文字即刻生成新提示”
前端·javascript
明月_清风16 小时前
告别后端转换:高质量批量导出实战
前端·javascript
刘发财21 小时前
弃用html2pdf.js,这个html转pdf方案能力是它的几十倍
前端·javascript·github
牛奶1 天前
2026年大模型怎么选?前端人实用对比
前端·人工智能·ai编程
牛奶1 天前
前端人为什么要学AI?
前端·人工智能·ai编程
Kagol1 天前
🎉OpenTiny NEXT-SDK 重磅发布:四步把你的前端应用变成智能应用!
前端·开源·agent
GIS之路1 天前
ArcGIS Pro 中的 notebook 初识
前端
JavaGuide1 天前
7 道 RAG 基础概念知识点/面试题总结
前端·后端
ssshooter1 天前
看完就懂 useSyncExternalStore
前端·javascript·react.js
格砸1 天前
从入门到辞职|从ChatGPT到OpenClaw,跟上智能时代的进化
前端·人工智能·后端