使用vue开发页面,在打开新增或编辑等对话框时,如果不小心点击非对话框的地方(model)就会关闭对话框,如果页面添加了表单清空,用户再次打开对话框的时候,表单内容已经被清空了,用户需要重新填,如果又不小心点了非对话框的地方……
可以使用 close-on-click-modal 来控制是否可以通过点击 modal 关闭 Dialog
<el-dialogtitle="对话框":visible.sync="centerDialogVisible":close-on-click-modal = "false" //不可以通过点击 modal 关闭 Dialogwidth="30%"
><span slot="footer" class="dialog-footer"><el-button @click="centerDialogVisible = false">取 消</el-button><el-button type="primary" @click="centerDialogVisible = false">确 定</el-button></span>
</el-dialog>