Element UI version
2.13.0
OS/Browsers version
Chrome Version 79.0.3945.79
Vue version
2.6.11
Reproduction Link
https://codepen.io/hollowcast/pen/MWYbQBw
Steps to reproduce
Create a dialog with option :destroy-on-close="true"
What is Expected?
Contents of the dialog should be destroyed after it closes. (Similar to the behavior of drawer destroy on close)
What is actually happening?
Contents are not destroyed.
8条答案
按热度按时间hc8w905p1#
Since your Form value is entered and determined, the value of the Form still exists when the dialog element is destroyed, and will be re-assigned when you reopen it
cedebl8k2#
Is there a way to solve this now?
vcudknz33#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
1u4esq0p4#
use v-if to solve?
vwkv1x7d5#
v-if can solve the problem
kpbpu0086#
Since your Form value is entered and determined, the value of the Form still exists when the dialog element is destroyed, and will be re-assigned when you reopen it
This is not due to the form data, when setting
destory-on-close=true
, element in the modal/drawer should be removed from dom, but now it exists, and modal style isdisplay: none
y0u0uwnf7#
v-if will destroy the animation effect when it is closed
z6psavjg8#
v-if will destroy the animation effect when it is closed
会破坏的,直接就没有动画效果啦