Bug Type: Component
Environment
- Vue Version:
3.2.45
- Element Plus Version:
2.2.25
- Browser / OS:
Chrome (latest)
- Build Tool:
Vue CLI
Reproduction
Related Component
el-select
Reproduction Link
Element Plus Playground
Steps to reproduce
When the value of an multi-select field is not set to an empty array initially but is undefined
, the error is already displayed on page-load, because the "change" is triggered.
What is Expected?
It should not trigger the validation for the initial page load.
What is actually happening?
An error is already shown.
Additional comments
Please have a look at the reproduction link for a demo.
2条答案
按热度按时间a2mppw5e1#
The initial value in the multiple mode must be an array
lqfhib0f2#
I know. But I think it is inconsistent with other fields (like el-input) where the initial value could also be empty (undefined and not an empty string).
Currently el-select is able to have an initial value of "undefined". It automatically transforms this to an array. But this seems to be implemented wrongly, as the validation trigger should be executed AFTER this transformation.