form-create icon indicating copy to clipboard operation
form-create copied to clipboard

No validation rules on compiled prod env

Open titeya opened this issue 3 years ago • 7 comments

@form-create/naive-ui@next naive-ui 2.28.2

Build tool: vite 2.9.6

When the schema has an array (group) or object component, validation rules are not applied to children. The problem only impacts the compiled version of the project. No problem on the development environment.

 {
    type: 'group',
    field: 'emails',
    title: 'Emails',
    value: [],
    props: {
      rule: [
        {
          type: 'input',
          field: 'email',
          title: 'Email',
          props: {
            placeholder: 'Email address',
          },
          validate: [{ required: true, message: 'This field is required', trigger: ['input', 'blur', 'change'] }],
        },
      ],
      expand: 1,
    },
  }

titeya avatar Apr 28 '22 08:04 titeya

Same behavior with Element-plus (v2.1.11) / @form-create/element-ui 3.1.5 / vite 2.9.6

titeya avatar Apr 28 '22 11:04 titeya

Thanks for the feedback, I'll check it out here

xaboy avatar Apr 30 '22 08:04 xaboy

I didn't reproduce the problem you asked link: https://stackblitz.com/edit/vitejs-vite-ktg8ey?file=index.html

xaboy avatar Apr 30 '22 11:04 xaboy

Thank you for answering. I was using version 3.1.5 which was problematic. It works fine with version 3.1.3.

titeya avatar May 03 '22 11:05 titeya

I reopen this issue because since version 1.4, the validation rules do not work with nested components (object, group).

See below :

https://stackblitz.com/edit/vitejs-vite-kndjxf?file=src%2FApp.vue,package.json

titeya avatar Jan 19 '23 09:01 titeya

Thanks for the feedback, it will be fixed in the next version

xaboy avatar Jan 29 '23 12:01 xaboy

The 3.1.18 version has been released

xaboy avatar Jan 31 '23 13:01 xaboy