Skip to content

Commit

Permalink
refactor: correct the type definition for popupContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
oljc committed Feb 27, 2024
1 parent dda3c06 commit 8310c13
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 22 deletions.
4 changes: 1 addition & 3 deletions packages/web-vue/components/cascader/cascader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,7 @@ export default defineComponent({
* @en Mount container for popup
*/
popupContainer: {
type: [String, Object] as PropType<
string | HTMLElement | null | undefined
>,
type: [String, Object] as PropType<string | HTMLElement>,
},
/**
* @zh 多选模式下,最多显示的标签数量。0 表示不限制
Expand Down
4 changes: 1 addition & 3 deletions packages/web-vue/components/date-picker/picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,7 @@ export default defineComponent({
* @en Mount container for pop-up box
*/
popupContainer: {
type: [String, Object] as PropType<
string | HTMLElement | null | undefined
>,
type: [String, Object] as PropType<string | HTMLElement>,
},
mode: {
type: String as PropType<'date' | 'year' | 'quarter' | 'month' | 'week'>,
Expand Down
4 changes: 1 addition & 3 deletions packages/web-vue/components/date-picker/range-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ export default defineComponent({
default: true,
},
popupContainer: {
type: [String, Object] as PropType<
string | HTMLElement | null | undefined
>,
type: [String, Object] as PropType<string | HTMLElement>,
},
locale: {
type: Object as PropType<Record<string, any>>,
Expand Down
4 changes: 1 addition & 3 deletions packages/web-vue/components/dropdown/dropdown-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ export default defineComponent({
* @en Mount container for popup
*/
popupContainer: {
type: [String, Object] as PropType<
string | HTMLElement | null | undefined
>,
type: [String, Object] as PropType<string | HTMLElement>,
},
/**
* @zh 是否禁用
Expand Down
2 changes: 1 addition & 1 deletion packages/web-vue/components/image/preview-group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default defineComponent({
* @en Set the mount point of the pop-up box, the same as the `to` of `teleport`, the default value is document.body
*/
popupContainer: {
type: [Object, String] as PropType<HTMLElement | string>,
type: [String, Object] as PropType<string | HTMLElement>,
},
},
emits: [
Expand Down
2 changes: 1 addition & 1 deletion packages/web-vue/components/popconfirm/popconfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default defineComponent({
* @en Mount container for popup
*/
popupContainer: {
type: [String, Object] as PropType<string | HTMLElement | undefined>,
type: [String, Object] as PropType<string | HTMLElement>,
},
/**
* @zh 触发 ok 事件前的回调函数。如果返回 false 则不会触发后续事件,也可使用 done 进行异步关闭。
Expand Down
4 changes: 1 addition & 3 deletions packages/web-vue/components/popover/popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ export default defineComponent({
* @en Mount container for pop-up box
*/
popupContainer: {
type: [String, Object] as PropType<
string | HTMLElement | null | undefined
>,
type: [String, Object] as PropType<string | HTMLElement>,
},
},
emits: {
Expand Down
4 changes: 1 addition & 3 deletions packages/web-vue/components/tooltip/tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ export default defineComponent({
* @en Mount container for popup
*/
popupContainer: {
type: [String, Object] as PropType<
string | HTMLElement | null | undefined
>,
type: [String, Object] as PropType<string | HTMLElement>,
},
},
emits: {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-vue/components/tree-select/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface TreeSelectProps {
filterTreeNode: FilterTreeNode | undefined;
loadMore: LoadMore | undefined;
disableFilter: boolean;
popupContainer: string | HTMLElement | null | undefined;
popupContainer?: string | HTMLElement;
fallbackOption: FallbackOption;
showHeaderOnEmpty?: boolean;
showFooterOnEmpty?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/web-vue/components/tree-select/tree-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export default defineComponent({
* @en Mount container for pop-up box
*/
popupContainer: {
type: [String, Object] as PropType<string | HTMLElement | undefined>,
type: [String, Object] as PropType<string | HTMLElement>,
},
/**
* @zh 为 value 中找不到匹配项的 key 定义节点数据
Expand Down

0 comments on commit 8310c13

Please sign in to comment.