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
Bug Type: Component
Component
3.4.29
2.7.5
chrome 125.0.6422.176
Vite
el-select
Element Plus Playground
<template> <el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" :rules="rules" label-width="auto" status-icon> <el-form-item label="Activity name" prop="name"> <el-input v-model="ruleForm.name" /> </el-form-item> <el-form-item label="Activity zone" prop="region"> <el-select clearable multiple v-model="ruleForm.region" placeholder="Activity zone"> <el-option label="Zone one" value="shanghai" /> <el-option label="Zone two" value="beijing" /> </el-select> </el-form-item> </el-form> </template> <script setup lang="ts"> import { reactive, ref } from 'vue' import type { FormInstance, FormRules } from 'element-plus' interface RuleForm { name: string region?: string[] } const ruleFormRef = ref<FormInstance>() const ruleForm = reactive<RuleForm>({ name: 'Hello', }) const rules = reactive<FormRules<RuleForm>>({ region: [ { required: true, message: 'Please select Activity zone', trigger: 'change', }, ], }) </script>
region 不设置初始值时,不触发校验
region 会触发表单校验
(empty)
The text was updated successfully, but these errors were encountered:
加上默认值 就不报红了 demo
Sorry, something went wrong.
没有填写默认值 会自动转换成Array,在源码里加了一个标志位可以解决这个问题: PR: #17284
PR:#17286
Successfully merging a pull request may close this issue.
Bug Type:
Component
Environment
3.4.29
2.7.5
chrome 125.0.6422.176
Vite
Reproduction
Related Component
el-select
Reproduction Link
Element Plus Playground
Steps to reproduce
What is Expected?
region 不设置初始值时,不触发校验
What is actually happening?
region 会触发表单校验
Additional comments
(empty)
The text was updated successfully, but these errors were encountered: