css flex使用--分栏效果

<template>
    <div class="goods">
      <div class="menu-wrapper"></div>
      <div class="foods-wrapper"></div>
    </div>
</template>
<style lang="stylus" rel="stylesheet/stylus">
  .goods {
    display flex
    position absolute
    top: 178px
    bottom 46px
    overflow hidden
    width: 100%
  }
  .goods .menu-wrapper {
    flex:0 0 80px
    width: 80px
    background-color lightgray
  }
  .goods .foods-wrapper {
    flex:1;
    background-color red
  }
</style>



<!-- EditorLayout.vue --> <script setup lang="ts"> import { ref, onMounted, onUnmounted } from 'vue' import LeftPanel from '../components/sceneEditor/LeftPanel.vue' import RightPanel from '../components/sceneEditor/RightPanel.vue' </script> <template> <!-- 主容器:明确 flex 横向布局 --> <div class="editor-container h-screen flex flex-row bg-gray-50 overflow-hidden"> <!-- 左侧固定宽度 --> <div class="left-panel w-[250px] flex-shrink-0 border-r border-gray-300 flex flex-col"> <LeftPanel /> </div> <!-- 中间占位:撑开剩余空间 --> <div class="placeholder-composite flex-1 min-w-0 flex flex-col relative"> <div class="middle-content" :style="{ height: `${topHeight}%` }"> <MiddlePanel /> </div> <div class="resizer-horizontal" @mousedown="startDrag" style=" height: 6px; background: #ddd; cursor: ns-resize; border-top: 1px solid #bbb; border-bottom: 1px solid #bbb; user-select: none; " ></div> <div class="model-library-wrapper border-t border-gray-300 bg-white" :style="{ height: `${bottomHeight}%`, minHeight: '80px' }" > <BottomModelLibrary /> </div> </div> <!-- 右侧固定宽度 --> <div class="right-panel w-[300px] flex-shrink-0 border-l border-gray-300 flex flex-col"> <RightPanel /> </div> </div> </template> <style scoped> /* 关键:确保所有子项全高 */ .editor-container { display: flex !important; flex-direction: row; height: 100vh; overflow: hidden; } /* 所有面板必须能继承高度 */ .left-panel, .right-panel { height: 100%; display: flex; flex-direction: column; } /* 占位符不需要内容,但要参与布局 */ .middle-placeholder { flex: 1; min-width: 0; } </style> 怎么写中间部分
最新发布
12-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值