element-plus [Component] [form] Form validateField method does not work with property path arrays

rjjhvcjd  于 5个月前  发布在  其他
关注(0)|答案(4)|浏览(65)

Bug Type: Component

Environment

  • Vue Version: 3.2.47
  • Element Plus Version: 2.2.29
  • Browser / OS: Firefox/108.0
  • Build Tool: Vite

Reproduction

  • el-form

CodePen

Steps to reproduce

Use arrays for property paths on ElForm items.
Pass property path arrays to validateField method.

What is Expected?

Validation occurs for selected fields.

What is actually happening?

ElementPlusError: [ElForm] please pass correct props!

Additional comments

Props passed to validateField are checked by Array.prototype.includes() in https://github.com/element-plus/element-plus/blob/dev/packages/components/form/src/utils.ts#L55

Since the path array that is passed to validateField is not the same array that was passed to ElFormItem component, includes() returns false .

v440hwme

v440hwme1#

But this is not an issue!

rt4zxlrg

rt4zxlrg2#

I'm sorry, @itsalimanuel, I don't understand what you mean by "not an issue".

Using arrays for property paths does not work in the way described in the documentation, does it?

fhg3lkii

fhg3lkii3#

I'm having this same issue, i'm not sure I understand what that response means

i1icjdpr

i1icjdpr4#

Hello @tripflex , are you looking for something like this ?

相关问题