vue首页多模块布局(标题布局)

java 复制代码
<template>

    <div class="box">

      <div class="content">
        <div class="box1" style="background-color: rgb(245,23,156)">第一个</div>
        <div class="box2" style="background-color: rgb(12,233,3)">第二个</div>
        <div class="box3" style="background-color: rgb(109,5,255)">第三个</div>
        <div class="box4" style="background-color: rgb(233,187,3)">第四个</div>
        <div class="box5" style="background-color: rgb(233,3,34)">第五个</div>
        <div class="box6" style="background-color: rgb(245,23,156)">第六个</div>
        <div class="box7" style="background-color: rgb(3,179,233)">第七个</div>
        <div class="box8" style="background-color: rgb(233,187,3)">第八个</div>
      </div>

    </div>

</template>

<script>
export default {
  components: {//组件

  },
  provide() {
    return {};
  },
  data() {
    return {};
  },
  created() { //创建时

  },
  methods: {}
};
</script>

<style scoped>
  .box{
    height: calc(100% - 40px);
    background-color: red;
    padding: 20px;
  }
  .content{
    width: 100%;
    height: 100%;
    background-color: #fff;

    /*  设置网格布局  */
    display: grid;
    /*  设置列数 每个行岁站的份数  */
    grid-template-columns: repeat(3,1fr);
    /*  设置行数 每个行所占的份数  */
    grid-template-rows: repeat(3,1fr);
    /*  网格间距  */
    gap: 10px;

  }
  /*  跨列  */
  .box7{
    grid-column: span 2;
  }

</style>
java 复制代码
<template>

    <div class="box">

      <div class="content">
        <div class="box0" style="background-color: #409EFF">
          此处未标题
        </div>
        <div class="box1" style="background-color: rgb(245,23,156)">第一个</div>
        <div class="box2" style="background-color: rgb(12,233,3)">第二个</div>
        <div class="box3" style="background-color: rgb(109,5,255)">第三个</div>
        <div class="box4" style="background-color: rgb(233,187,3)">第四个</div>
        <div class="box5" style="background-color: rgb(233,3,34)">第五个</div>
        <div class="box6" style="background-color: rgb(245,23,156)">第六个</div>
        <div class="box7" style="background-color: rgb(3,179,233)">第七个</div>
        <div class="box8" style="background-color: rgb(233,187,3)">第八个</div>
      </div>

    </div>

</template>

<script>
export default {
  components: {//组件

  },
  provide() {
    return {};
  },
  data() {
    return {};
  },
  created() { //创建时

  },
  methods: {}
};
</script>

<style scoped>
  .box{
    height: calc(100% - 40px);
    background-color: red;
    padding: 20px;
  }
  .content{
    width: 100%;
    height: 100%;
    background-color: #fff;

    /*  设置网格布局  */
    display: grid;
    /*  设置列数 每个行岁站的份数  */
    grid-template-columns: repeat(3,1fr);
    /*  设置行数 每个行所占的份数  这种是统一样式固定排列
    grid-template-rows: repeat(3,1fr);*/

    grid-template-rows: 50px 1fr 1fr 1fr;/* 解读: 第一行50px高度 后面默认统一 */


    /*  网格间距  */
    gap: 10px;

  }
  /*  跨列  */
  .box7{
    grid-column: span 2;
  }
  .box0{
    grid-column: span 3;
  }

</style>
相关推荐
虚妄狼8 分钟前
【Nuxt3】安装 Naive UI 按需自动引入组件
ui·vue
西哥写代码13 小时前
基于cornerstone3D的dicom影像浏览器 第十八章 自定义序列自动播放条
前端·javascript·vue
菜是一种态度15 小时前
Vue-监听属性
vue·监听属性·深度监听
BuLingLings17 小时前
vue3_flask实现mysql数据库对比功能
数据库·mysql·flask·vue
GanGuaGua2 天前
Vue3:脚手架
前端·javascript·css·vue.js·vue
大叔_爱编程2 天前
p024基于Django的网上购物系统的设计与实现
python·django·vue·毕业设计·源码·课程设计·网上购物系统
满怀10153 天前
【Vue 3全栈实战】从响应式原理到企业级架构设计
前端·javascript·vue.js·vue
Minyy113 天前
Vue3指令(二)--v-text、v-html数据渲染,计算属性
前端·javascript·vue.js·前端框架·vue·html
.生产的驴3 天前
Vue3 加快页面加载速度 使用CDN外部库的加载 提升页面打开速度 服务器分发
运维·服务器·前端·vue.js·分布式·前端框架·vue
程序员阿明4 天前
vite运行只能访问localhost解决办法
前端·vue