el-dialog destroy-on-close
时间: 2023-08-01 18:07:39 浏览: 71
在使用elementUI的弹窗插件el-dialog时,destroy-on-close属性的作用是在关闭弹窗时是否销毁弹窗内的内容。根据引用\[1\]中的代码,设置destroy-on-close为true时,每次关闭弹窗后,弹窗内的内容会被销毁,下次打开时需要重新渲染。但是根据引用\[2\]的描述,有时候设置destroy-on-close为true可能会无效,可能是因为该属性的使用方式不正确或者其他原因导致。在引用\[3\]中的代码示例中,el-dialog作为子组件使用时,通过控制dialogVisible属性来控制弹窗的显示与隐藏,同时可以通过设置dialogType属性来确定弹窗的类型。在关闭弹窗时,可以通过调用handleClose方法来关闭弹窗并重置表单数据。
#### 引用[.reference_title]
- *1* *3* [el-dialog 的各种正确使用姿势 以及 el-dialog destroy-on-close 无效的解决办法](https://blog.csdn.net/qq_21473443/article/details/127106152)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Vue2+ElementUI el-form resetFields()方法重置无效,el-dialog destroy-on-close无效](https://blog.csdn.net/weixin_45701630/article/details/126704490)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)