html css - 左边是不能滚动的目录,右边是可以滚动的内容

如图:

javascript 复制代码
<template>
  <el-dialog v-model="dialogVisible" title="预览文件" width="80%" :before-close="handleClose">
    <div class="main-box-container">
      <div class="left-box">
        <div v-for="item in fileNameList" :key="item">{{ item }}</div>
      </div>

      <div class="right-box">
        <div v-for="(value, index) in 50">案件客户端接口拉黑 - {{ index }}</div>
      </div>
    </div>
  </el-dialog>
</template>

<script lang="ts" setup>
let objInfo = ref({})
const dialogVisible = ref(false)

const handleClose = () => {
  dialogVisible.value = false
}

let fileNameList = ref([])
let filePathList = ref([])
const open = (info) => {
  dialogVisible.value = true
  objInfo.value = info
  console.log('objInf=', objInfo.value)

  fileNameList.value = info.fileNames?.split(',')
  filePathList.value = info.filePaths?.split(',')
}

defineExpose({
  open
})
</script>

<style lang="scss" scoped>
.main-box-container {
  display: flex;
  overflow: hidden;
  max-height: calc(90vh - 160px) !important;
}

.left-box {
  flex: 1;
  background-color: pink;
  overflow-y: scroll;
}

.right-box {
  flex: 5;
  background-color: aqua;
  overflow-y: scroll;
}
</style>
相关推荐
我命由我123451 天前
SVG - SVG 引入(SVG 概述、SVG 基本使用、SVG 使用 CSS、SVG 使用 JavaScript、SVG 实例实操)
开发语言·前端·javascript·css·学习·ecmascript·学习方法
霍理迪1 天前
CSS文本样式
前端·css
研☆香1 天前
html页面如何精准布局
前端·html
自由与自然1 天前
实现类似van-dialog自定义弹框
前端·javascript·html
Goodbaibaibai2 天前
Element自定义主题色
前端·css·css3
灰海2 天前
为什么给<a>标签设置了download属性, 浏览器没有下载而是打开新标签!!
前端·vue·html·下载·download
GDAL2 天前
html返回顶部实现方式对比
前端·html·返回顶部
weixin_440730502 天前
HTML中的css和js的书写样式
javascript·css·html
我是伪码农2 天前
动态表格案例
前端·javascript·html
我是伪码农2 天前
随机点名案例
前端·css·css3