方法一:
<style scoped> ::v-deep .el-dialog .el-dialog-body{ height: 500px; overflow-y: auto; } </style>
如果要设置动态的高度话,则要在setup里面设置
<script > export default defineComponent({ setup:{ const cssContent=ref({height:'100%',overflowY:''}) const init=()=>{ cssContent.value.height='500px' cssContent.value.overflowY='auto' } init() return { cssContent, init } } }) </script> <style scoped> ::v-deep .el-dialog .el-dialog-body{ height: v-bind('cssContent.height'); overflow-y: v-bind('cssContent.overflowY'); } </style>
标签:el,overflowY,height,滚动条,init,dialog,cssContent From: https://www.cnblogs.com/zhian/p/18109182