Skip to content

If the form input box component detects the required prompt, if the external setting value is used, the abnormal prompt still exists #4955

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

Closed
menkeydyvh opened this issue Nov 30, 2021 · 3 comments
Labels

Comments

@menkeydyvh
Copy link
Contributor

Version

3.0.0-alpha.11

<template>
    <a @click="() => { model.input = model.date = '2017-01-01' }">2017-01-01</a>
    <a-form ref="formRef" :model="model" :rules="rules">
        <a-form-item name="date">
            <a-date-picker v-model:value="model.date" valueFormat="YYYY-MM-DD" />
        </a-form-item>
        <a-form-item name="input">
            <a-input v-model:value="model.input" />
        </a-form-item>
    </a-form>
</template>
<script>
import { defineComponent, ref } from "vue";
export default defineComponent({
    components: {},
    setup() {
        const model = ref({
            date: null
        }), rules = ref({
            input: [
                {
                    required: true,
                    message: "必须填写",
                },
            ],
            date: [
                {
                    required: true,
                    message: "必须填写时间",
                },
            ],
        });
        return {
            model,
            rules,
        };
    },
});
</script>

Steps to reproduce

简略代码如上方所示。请检查其他输入控件应该都有一样的问题
1.针对输入框输入值
2.去掉这些值,让必填验证展示出来
3.点击外部a来设置值

What is expected?

必填检测验证通过

What is actually happening?

必填检测未触发检测必填提示依然存在
image

@github-actions github-actions bot changed the title 表单输入框组件 在检测必填提示后如果使用外部设置值 异常提示依然存在 If the form input box component detects the required prompt, if the external setting value is used, the abnormal prompt still exists Nov 30, 2021
tangjinzhou added a commit that referenced this issue Nov 30, 2021
@tangjinzhou
Copy link
Member

下个版本会回滚这个改动,这不是bug,主动赋值不应该自动校验,你应该手动触发校验 @menkeydyvh

@menkeydyvh
Copy link
Contributor Author

下个版本会回滚这个改动,这不是bug,主动赋值不应该自动校验,你应该手动触发校验 @menkeydyvh

ok,你这么一说有点理解了这样做的意图

tangjinzhou added a commit that referenced this issue Dec 23, 2021
* doc: add form demo

* fix: form dynamic error

* doc: add form demo

* revert: formitem auto validate #4955

* fix: input not update when set undefined

* doc: add form demo

* fix: form validate for number tyope, close #5064

* fix: form validateMessages not work

* doc: add form demo
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants