ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.12k stars 14.64k forks source link

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

Open jadvillafania opened 4 years ago

jadvillafania commented 4 years ago

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.

xrkffgg commented 4 years ago

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

chenhw commented 4 years ago

Is there a way to solve this now?

stale[bot] commented 3 years ago

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.

PearpearS commented 3 years ago

use v-if to solve?

penpeni commented 3 years ago

v-if can solve the problem

plainnany commented 3 years ago

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

wchbrad commented 3 years ago

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

PearpearS commented 3 years ago

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

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