feat(components): [el-pagination] add teleported prop (#14072)

* fix(components): [pagination] 修复toplayer全屏模式下分页下拉框无法显示问题

分页组件新增teleported参数 默认为true  便于用户控制size下拉框是否插入body

closed #14070

* docs(docs): [pagination] Add a teleported attribute

closed #14070

* fix(components): [pagination] teleported props default value

delete set teleported default value

closed #14070

* fix(components): [pagination] change the default value of teleported

change the default value of teleported to true

* Update docs/en-US/component/pagination.md

Co-authored-by: qiang <qw13131wang@gmail.com>

---------

Co-authored-by: shaojia.cheng <shaojia.cheng@arvetech.net>
Co-authored-by: qiang <qw13131wang@gmail.com>
This commit is contained in:
boomboy4 2023-09-06 08:14:58 +08:00 committed by GitHub
parent ce2315d734
commit 9a60a90e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 0 deletions

View File

@ -84,6 +84,7 @@ pagination/more-elements
| next-text | text for the next button | ^[string] | '' |
| next-icon | icon for the next button, has a lower priority than `next-text` | ^[string] / ^[Component] | ArrowRight |
| disabled | whether Pagination is disabled | ^[boolean] | false |
| teleported ^(2.3.13) | whether Pagination select dropdown is teleported to the body | ^[boolean] | true |
| hide-on-single-page | whether to hide when there's only one page | ^[boolean] | false |
:::warning

View File

@ -16,6 +16,7 @@ export const paginationSizesProps = buildProps({
type: String,
},
disabled: Boolean,
teleported: Boolean,
size: {
type: String,
values: componentSizes,

View File

@ -5,6 +5,7 @@
:disabled="disabled"
:popper-class="popperClass"
:size="size"
:teleported="teleported"
:validate-event="false"
@change="handleChange"
>

View File

@ -137,6 +137,13 @@ export const paginationProps = buildProps({
type: iconPropType,
default: () => ArrowRight,
},
/**
* @description whether Pagination size is teleported to body
*/
teleported: {
type: Boolean,
default: true,
},
/**
* @description whether to use small pagination
*/
@ -369,6 +376,7 @@ export default defineComponent({
pageSizes: props.pageSizes,
popperClass: props.popperClass,
disabled: props.disabled,
teleported: props.teleported,
size: props.small ? 'small' : 'default',
}),
slot: slots?.default?.() ?? null,