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>

 

posted @ 2024-04-01 19:04  ☆♂安♀★  阅读(1086)  评论(0编辑  收藏  举报