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>
相关推荐
向明天乄4 分钟前
Maotu流程图编辑器:Vue3项目中的集成实战与自定义流程开发指南
javascript·编辑器·vue·流程图
@一枝梅15 小时前
vue3 vite.config.js 引入bem.scss文件报错
javascript·rust·vue·scss
胡斌附体18 小时前
表单设计器拖拽对象时添加属性
vue·vuedraggable·draggable·clone的使用·遇到的问题
年老体衰按不动键盘1 天前
快速部署和启动Vue3项目
java·javascript·vue
Bug从此不上门2 天前
【无标题】
前端·javascript·uni-app·vue
狼性书生2 天前
uniapp实现的简约美观的星级评分组件
前端·uni-app·vue·组件
宇宙的最后一粒尘埃3 天前
Typeerror: cannot read properties of undefined (reading ‘XXX‘)
vue
清幽竹客4 天前
vue-18(使用 Vuex 插件实现高级功能)
前端·vue.js·前端框架·vue
牧码岛4 天前
Web前端之隐藏元素方式的区别、Vue循环标签的时候在同一标签上隐藏元素的解决办法、hidden、display、visibility
前端·css·vue·html·web·web前端
MINO吖4 天前
基于 qiankun + vite + vue3 构建微前端应用实践
vue·vite·微前端·qiankun·single-spa