Skip to content

Commit 00cf241

Browse files
committed
feat: update type
1 parent f8cef20 commit 00cf241

File tree

3 files changed

+18
-33
lines changed

3 files changed

+18
-33
lines changed

components/locale-provider/index.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ export interface Locale {
3737
global?: Record<string, any>;
3838
PageHeader?: { back: string };
3939
Icon?: Record<string, any>;
40-
Text?: Record<string, any>;
40+
Text?: {
41+
edit?: any;
42+
copy?: any;
43+
copied?: any;
44+
expand?: any;
45+
};
4146
}
4247

4348
export interface LocaleProviderProps {

components/message/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function setMessageConfig(options: ConfigOptions) {
4848
}
4949
if (options.getContainer !== undefined) {
5050
getContainer = options.getContainer;
51+
messageInstance = null; // delete messageInstance for new getContainer
5152
}
5253
if (options.transitionName !== undefined) {
5354
transitionName = options.transitionName;

components/vc-overflow/Overflow.tsx

+11-32
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CSSProperties, HTMLAttributes, PropType } from 'vue';
1+
import type { CSSProperties, ExtractPropTypes, HTMLAttributes, PropType } from 'vue';
22
import { computed, defineComponent, ref, watch } from 'vue';
33
import ResizeObserver from '../vc-resize-observer';
44
import classNames from '../_util/classNames';
@@ -16,36 +16,8 @@ function defaultRenderRest<ItemType>(omittedItems: ItemType[]) {
1616
return `+ ${omittedItems.length} ...`;
1717
}
1818

19-
export interface OverflowProps<ItemType> extends HTMLAttributes {
20-
prefixCls?: string;
21-
data?: ItemType[];
22-
itemKey?: Key;
23-
/** Used for `responsive`. It will limit render node to avoid perf issue */
24-
itemWidth?: number;
25-
renderItem?: (item: ItemType) => VueNode;
26-
/** @private Do not use in your production. Render raw node that need wrap Item by developer self */
27-
renderRawItem?: (item: ItemType, index: number) => VueNode;
28-
maxCount?: number | typeof RESPONSIVE | typeof INVALIDATE;
29-
renderRest?: VueNode | ((omittedItems: ItemType[]) => VueNode);
30-
/** @private Do not use in your production. Render raw node that need wrap Item by developer self */
31-
renderRawRest?: (omittedItems: ItemType[]) => VueNode;
32-
suffix?: VueNode;
33-
component?: any;
34-
itemComponent?: any;
35-
36-
/** @private This API may be refactor since not well design */
37-
onVisibleChange?: (visibleCount: number) => void;
38-
39-
/** When set to `full`, ssr will render full items by default and remove at client side */
40-
ssr?: 'full';
41-
42-
onMousedown?: MouseEventHandler;
43-
}
44-
45-
const Overflow = defineComponent({
46-
name: 'Overflow',
47-
inheritAttrs: false,
48-
props: {
19+
const overflowProps = () => {
20+
return {
4921
id: String,
5022
prefixCls: String,
5123
data: Array,
@@ -67,7 +39,14 @@ const Overflow = defineComponent({
6739
/** When set to `full`, ssr will render full items by default and remove at client side */
6840
ssr: String as PropType<'full'>,
6941
onMousedown: Function as PropType<MouseEventHandler>,
70-
},
42+
};
43+
};
44+
type InterOverflowProps = Partial<ExtractPropTypes<ReturnType<typeof overflowProps>>>;
45+
export type OverflowProps = HTMLAttributes & InterOverflowProps;
46+
const Overflow = defineComponent<OverflowProps>({
47+
name: 'Overflow',
48+
inheritAttrs: false,
49+
props: overflowProps() as any,
7150
emits: ['visibleChange'],
7251
setup(props, { attrs, emit }) {
7352
const fullySSR = computed(() => props.ssr === 'full');

0 commit comments

Comments
 (0)