vue element-ui的对话框dialog没有height怎么解决?

饿了么的对话框 https://element.eleme.cn/#/zh-CN/component/dialog

 

思路:直接获得dialog,然后强制加height

见如下代码:

<el-dialog
  ref="elDialog"
  title="提示"
  :visible.sync="dialogVisible"
  width="30%"
  :before-close="handleClose">
  <span>这是一段信息</span>
  <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  </span>
</el-dialog>


this.$refs.elDialog[0].$el.firstChild.style.height = '90%';

 

 

posted on 2019-12-04 10:13  技术高超  阅读(8901)  评论(0)    收藏  举报