-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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(pagination) : add size
prop
#16858
base: dev
Are you sure you want to change the base?
Conversation
BREAKING CHANGE : size closed element-plus#16830
# Conflicts: # packages/components/pagination/src/pagination.ts
👋 @webvs2, seems like this is your first time contribution to element-plus.
|
🧪 Playground Preview: https://element-plus.run/?pr=16858 |
size
prop
I think it would also be good to add unified global setting size support to |
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.
I think it would be better to use useFormSize to get size for el-pagination. |
The purpose of this function is to get the size of the previous level rather than just relying on the global, and the use is that if the size is set like 'from', it is actually good to use the local t mentioned above, right? |
useFormSize obtains size in the order of props, formItem, form, globalConfig |
Yes, I looked at what the function does so it makes more sense to rely on the parent, which I will adjust |
We should keep |
I do not understand |
We can add a new |
就是新旧api都先留着,旧的api可以在下个大版本中删除 |
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.
I think we can also add reminders for attribute changes
useDeprecated()
@@ -67,7 +67,7 @@ pagination/more-elements | |||
|
|||
| Name | Description | Type | Default | | |||
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------ | | |||
| small | whether to use small pagination | ^[boolean] | false | | |||
| size | pagination size | ^[enum]`'large'\| 'default'\| 'small'` | 'default' | |
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.
The original prop should be retained to facilitate users to synchronize API changes
size ^(2.7.4)
small ^(deprecated)
@@ -33,7 +33,6 @@ function useStyles<T>(props: Partial<TableBodyProps<T>>) { | |||
) { | |||
classes.push('current-row') | |||
} | |||
|
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.
This change seems unnecessary
const _size = useFormSize( | ||
computed(() => (props.small ? 'small' : vnodeProps?.size)) | ||
) |
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.
The Pagination component should not belong to the form component, and I don't quite understand why it is handled this way
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.
I think 'useFormSize' can be managed uniformly, and this will also work if the user puts it in 'from'
Co-authored-by: qiang <[email protected]>
Please make sure these boxes are checked before submitting your PR, thank you!
dev
branch.close #16830