vue3 设置el-dialog height超过滚动条
方法一:
<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>