From 9a60a90e1e1d089d7e2decafd04232bc69839eba Mon Sep 17 00:00:00 2001 From: boomboy4 <37095891+boomboy4@users.noreply.github.com> Date: Wed, 6 Sep 2023 08:14:58 +0800 Subject: [PATCH] feat(components): [el-pagination] add teleported prop (#14072) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --------- Co-authored-by: shaojia.cheng Co-authored-by: qiang --- docs/en-US/component/pagination.md | 1 + packages/components/pagination/src/components/sizes.ts | 1 + packages/components/pagination/src/components/sizes.vue | 1 + packages/components/pagination/src/pagination.ts | 8 ++++++++ 4 files changed, 11 insertions(+) diff --git a/docs/en-US/component/pagination.md b/docs/en-US/component/pagination.md index 64384dda19..0628672f1f 100644 --- a/docs/en-US/component/pagination.md +++ b/docs/en-US/component/pagination.md @@ -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 diff --git a/packages/components/pagination/src/components/sizes.ts b/packages/components/pagination/src/components/sizes.ts index 7f45efbac2..256faaf9c4 100644 --- a/packages/components/pagination/src/components/sizes.ts +++ b/packages/components/pagination/src/components/sizes.ts @@ -16,6 +16,7 @@ export const paginationSizesProps = buildProps({ type: String, }, disabled: Boolean, + teleported: Boolean, size: { type: String, values: componentSizes, diff --git a/packages/components/pagination/src/components/sizes.vue b/packages/components/pagination/src/components/sizes.vue index 956216c68a..a5f230de7a 100644 --- a/packages/components/pagination/src/components/sizes.vue +++ b/packages/components/pagination/src/components/sizes.vue @@ -5,6 +5,7 @@ :disabled="disabled" :popper-class="popperClass" :size="size" + :teleported="teleported" :validate-event="false" @change="handleChange" > diff --git a/packages/components/pagination/src/pagination.ts b/packages/components/pagination/src/pagination.ts index f04ec59ff7..275d9b492c 100644 --- a/packages/components/pagination/src/pagination.ts +++ b/packages/components/pagination/src/pagination.ts @@ -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,