Skip to content

[Component] [drawer, form] ElDrawer组件在和ElForm组件搭配使用时,启用:destroy-on-close="true"属性,form表单的部分数据依然存在 #21669

@DaChuanHaiyanZhang

Description

@DaChuanHaiyanZhang

Bug Type: Component

Environment

  • Vue Version: 3.5.13
  • Element Plus Version: 2.10.5
  • Browser / OS: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0
  • Build Tool: Vite

Reproduction

Related Component

  • el-drawer
  • el-form

Reproduction Link

Link

Steps to reproduce

点击案例中的【打开弹窗】在表单中输入内容,然后关闭弹窗,再重新打开,表单中的数据依然存在

What is Expected?

按照我的理解实际上是在关闭的时候会直接销毁,并且重置为初始化状态

What is actually happening?

表单并未重置,需要做很多的操作,例如重置form的model值,甚至还要在关闭之前调用更多的方法来重置

Additional comments

这个问题貌似在dialog组件中也存在,希望引起重视,或者给一个合理的解决方案,复杂表单的处理简直让人欲哭无泪啊。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions