Skip to content

表单输入一个值后,来回切换,会产生无效dom,分离的元素 #8372

@mkangm

Description

@mkangm

复现步骤,下面两个vue文件,只要不输入input的内容,点击66666切换就不会产生,只要输入一次后,点击切换就产生了 无法回收

Image

`vue
// 入口app

<script setup lang="ts"> import { ref } from 'vue'; import { Form, Row } from 'ant-design-vue'; import Render from './render' import FormComponents from './components/FormComponents.vue' const count = ref(0) const addCount = () => { count.value += 1 resetFields() formData.value.id= 'form' + count.value console.log('count', count.value) } const formData = ref({ id: 'form1', data: [] }) const { resetFields } = Form.useForm(formData) </script>
66666

// FormComponents 组件



{{ value }}
<script setup lang="ts"> import { FormItem, Input } from 'ant-design-vue' const arr = new Array(100).fill(0).map((_, i) => i) </script>

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions