From 6030024c6c73834ef5061c9eda4c3dea16525d2b Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sun, 19 Jan 2025 13:07:16 +0800 Subject: [PATCH 1/2] feat: add `extendValidator` prop --- 0000-custom-validator-warn.md | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 0000-custom-validator-warn.md diff --git a/0000-custom-validator-warn.md b/0000-custom-validator-warn.md new file mode 100644 index 00000000..19e1ef2e --- /dev/null +++ b/0000-custom-validator-warn.md @@ -0,0 +1,54 @@ +- Start Date: (2025-01-19) +- Target Major Version: (3.x) +- Reference Issues: (fill in existing related issues, if any) +- Implementation PR: (leave this empty) + +# Summary + +Expand the warning information of validator verification to provide clearer error prompts. + +# Basic example + +```vue + +``` + +# Motivation + +In custom components, we usually validate many props for a better user experience. Currently, the validator function will only return true or false. If it is false, it means that the validation has failed and a warning message will be thrown inside vue. + +However, the warning message only indicates that a prop check failed, but users cannot customize and expand more specific error descriptions. + +# Detailed design + +In order not to affect the original users, it may be a good idea to add a new function to give users more customization space. + +refer #Basic example + +# Drawbacks + +In most cases, the current validator function will suffice. (This proposal is merely to optimize the development experience based on the original one.) + +# Alternatives + +Add new parameters based on the original validator and make different processing according to different parameters. + +# Adoption strategy + + +# Unresolved questions + +N/A \ No newline at end of file From 58ec45767b3d122f722f0bc006970164fa0f0d93 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sun, 19 Jan 2025 13:11:59 +0800 Subject: [PATCH 2/2] chore: move --- .../0000-custom-validator-warn.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 0000-custom-validator-warn.md => active-rfcs/0000-custom-validator-warn.md (100%) diff --git a/0000-custom-validator-warn.md b/active-rfcs/0000-custom-validator-warn.md similarity index 100% rename from 0000-custom-validator-warn.md rename to active-rfcs/0000-custom-validator-warn.md