We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⚠️ 重要 ⚠️ 在进一步操作之前,请检查下列选项。如果您忽视此模板或者没有提供关键信息,您的 Issue 将直接被关闭
点击页面重置 按钮的时候,应该重置成componentProps的defaultValue。 目前在进行了值的修改后点击重置 后却变成空值
重置
<template> <Alert message="bug" /> <BasicForm @register="registerCustom" class="my-5" /> <Button @click="reset">点我还原默认值</Button> </template> <script setup lang="ts"> import { Alert,Button } from 'ant-design-vue'; import { BasicForm, FormSchema, useForm } from '@/components/Form'; const schemasCustom: FormSchema[] = [ { field: 'field1', component: 'ApiSelect', label: '字段1', componentProps: { defaultValue:"杰克", api: () => { return new Promise((resolve) => { resolve([ { label: '111杰克', value: '杰克', }, { label: '222伊莱克斯', value: '伊莱克斯', }, ]); }); }, }, }, { field: 'field2', component: 'Input', label: '字段2', required:true, componentProps: { defaultValue:"默认input" }, }, ]; const [registerCustom,{resetFields}] = useForm({ labelWidth: 160, schemas: schemasCustom, }); const reset = ()=>{ resetFields() } </script>
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
描述 Bug
点击页面
重置
按钮的时候,应该重置成componentProps的defaultValue。目前在进行了值的修改后点击
重置
后却变成空值复现 Bug
The text was updated successfully, but these errors were encountered: