element [Bug Report] Dialog contents not destroyed even with :destroy-on-close="true"

kpbwa7wx  于 2022-10-23  发布在  其他
关注(0)|答案(8)|浏览(156)

Element UI version

2.13.0

OS/Browsers version

Chrome Version 79.0.3945.79

Vue version

2.6.11

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.

hc8w905p

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

cedebl8k

cedebl8k2#

Is there a way to solve this now?

vcudknz3

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.

vwkv1x7d

vwkv1x7d5#

v-if can solve the problem

kpbpu008

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 is display: none

y0u0uwnf

y0u0uwnf7#

v-if will destroy the animation effect when it is closed

z6psavjg

z6psavjg8#

v-if will destroy the animation effect when it is closed

会破坏的,直接就没有动画效果啦

相关问题