Skip to content
New issue

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

useForm . setFieldsValue 给 input 赋值null 或 undefined 无效 #320

Closed
tky753 opened this issue Mar 4, 2021 · 0 comments
Closed

useForm . setFieldsValue 给 input 赋值null 或 undefined 无效 #320

tky753 opened this issue Mar 4, 2021 · 0 comments

Comments

@tky753
Copy link

tky753 commented Mar 4, 2021

Subject of the issue

如题,
在:vue-vben-admin\src\views\demo\page\form\basic\data.ts

export const schemas: FormSchema[] = [
  {
    field: 'title',
    defaultValue: '默认',  //加上这句
    component: 'Input',
    label: '标题',
    componentProps: {
      placeholder: '给目标起个名字',
    },
    required: true,
  },
......

在:vue-vben-admin\src\views\demo\page\form\basic\index.vue

    const [register, { validate, setProps, setFieldsValue }] = useForm({
    ....
    onMounted(() => {
      setFieldsValue({ title: null });
    });

界面打开后,显示的是默认,而不是空
image

Your environment

Ver 2.0.2

Expected behaviour

标题:

Actual behaviour

标题: 默认

@anncwb anncwb closed this as completed in 8f76ef4 Mar 4, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Sep 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant