0
点赞
收藏
分享

微信扫一扫

Element 对话框 el-dialog 强制渲染


element为了优化性能,在弹框未首次打开之前,是会不渲染弹框body中的内容的,一般情况下这样的设定是没有问题的,弹框未打开时我们一般也是不需要对弹框内容做操作的,但是在一些特殊情况,可能就有问题了

解决办法:

<el-dialog
title="设计配置项"
:visible.sync="designDialogVisible"
width="1600px"
ref="designDialog"
>
<div>
1
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="designDialogVisible = false"
>取 消</el-button
>
<el-button
type="primary"
size="small"
@click="handleDesignDialogSubmit()"
>确 定</el-button
>
</span>
</el-dialog>

mounted() {
this.$refs.designDialog.rendered = true
}

antd 的 Model组件可以通过forceRender属性解决这个问题

​​https://ant.design/components/modal-cn/​​

Element 对话框 el-dialog 强制渲染_javascript

 

举报

相关推荐

Qt添加Dialog对话框

0 条评论