elementui dialog fixed height

Today, I used the dialog to display the echarts diagram. Because it contains a tab page, the first tab page displays an icon, and the second tab page displays two icons. The upper and lower positions will cause the height of the dialog to occur when the tab is switched. Change, the official website only has the setting width, which can be solved by the following method

Write a div in the dialog and set the size of the div to the size of the relative window.

<el-dialog
      class="dialog"
      :visible.sync="dialogVisible"
      top="1%"
      :title="dialogTitle"
      @close="handleClose"
      width="50%"
      
    >

    <div class="el-dialog-div">

          //省略其他内容
   </div >

</el-dialog>



<style lang="scss" scoped>
 .el-dialog-div{
    height: 60vh;
     overflow: auto;
    }

</style>

 

Guess you like

Origin blog.csdn.net/CarryBest/article/details/89396354