-
-
Notifications
You must be signed in to change notification settings - Fork 16.1k
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
feat(components): [container] add validation for the direction
prop
#16734
base: dev
Are you sure you want to change the base?
Conversation
- I found that the orientation attribute of the Container component was not validated. - So I added enumeration value validation to the component
👋 @chenyuqiua, seems like this is your first time contribution to element-plus.
|
Hello @chenyuqiua, thank you for contributing to element-plus, please see our guideline to see how to make contribution |
🧪 Playground Preview: https://element-plus.run/?pr=16734 |
direction
prop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -18,6 +19,7 @@ const props = defineProps({ | |||
*/ | |||
direction: { | |||
type: String, | |||
validator: isDirectionType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validator: isDirectionType, | |
validator: (val: string) => ['horizontal', 'vertical'].includes(val), |
Because the direction
attribute is 'ltr' | 'rtl' | 'ttb' | 'btt'
in the ElDrawer component, moving the validator
to the global may not be a good idea.
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.