feat: update type
parent
f8cef206f3
commit
00cf241315
|
@ -37,7 +37,12 @@ export interface Locale {
|
||||||
global?: Record<string, any>;
|
global?: Record<string, any>;
|
||||||
PageHeader?: { back: string };
|
PageHeader?: { back: string };
|
||||||
Icon?: Record<string, any>;
|
Icon?: Record<string, any>;
|
||||||
Text?: Record<string, any>;
|
Text?: {
|
||||||
|
edit?: any;
|
||||||
|
copy?: any;
|
||||||
|
copied?: any;
|
||||||
|
expand?: any;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LocaleProviderProps {
|
export interface LocaleProviderProps {
|
||||||
|
|
|
@ -48,6 +48,7 @@ function setMessageConfig(options: ConfigOptions) {
|
||||||
}
|
}
|
||||||
if (options.getContainer !== undefined) {
|
if (options.getContainer !== undefined) {
|
||||||
getContainer = options.getContainer;
|
getContainer = options.getContainer;
|
||||||
|
messageInstance = null; // delete messageInstance for new getContainer
|
||||||
}
|
}
|
||||||
if (options.transitionName !== undefined) {
|
if (options.transitionName !== undefined) {
|
||||||
transitionName = options.transitionName;
|
transitionName = options.transitionName;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { CSSProperties, HTMLAttributes, PropType } from 'vue';
|
import type { CSSProperties, ExtractPropTypes, HTMLAttributes, PropType } from 'vue';
|
||||||
import { computed, defineComponent, ref, watch } from 'vue';
|
import { computed, defineComponent, ref, watch } from 'vue';
|
||||||
import ResizeObserver from '../vc-resize-observer';
|
import ResizeObserver from '../vc-resize-observer';
|
||||||
import classNames from '../_util/classNames';
|
import classNames from '../_util/classNames';
|
||||||
|
@ -16,36 +16,8 @@ function defaultRenderRest<ItemType>(omittedItems: ItemType[]) {
|
||||||
return `+ ${omittedItems.length} ...`;
|
return `+ ${omittedItems.length} ...`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OverflowProps<ItemType> extends HTMLAttributes {
|
const overflowProps = () => {
|
||||||
prefixCls?: string;
|
return {
|
||||||
data?: ItemType[];
|
|
||||||
itemKey?: Key;
|
|
||||||
/** Used for `responsive`. It will limit render node to avoid perf issue */
|
|
||||||
itemWidth?: number;
|
|
||||||
renderItem?: (item: ItemType) => VueNode;
|
|
||||||
/** @private Do not use in your production. Render raw node that need wrap Item by developer self */
|
|
||||||
renderRawItem?: (item: ItemType, index: number) => VueNode;
|
|
||||||
maxCount?: number | typeof RESPONSIVE | typeof INVALIDATE;
|
|
||||||
renderRest?: VueNode | ((omittedItems: ItemType[]) => VueNode);
|
|
||||||
/** @private Do not use in your production. Render raw node that need wrap Item by developer self */
|
|
||||||
renderRawRest?: (omittedItems: ItemType[]) => VueNode;
|
|
||||||
suffix?: VueNode;
|
|
||||||
component?: any;
|
|
||||||
itemComponent?: any;
|
|
||||||
|
|
||||||
/** @private This API may be refactor since not well design */
|
|
||||||
onVisibleChange?: (visibleCount: number) => void;
|
|
||||||
|
|
||||||
/** When set to `full`, ssr will render full items by default and remove at client side */
|
|
||||||
ssr?: 'full';
|
|
||||||
|
|
||||||
onMousedown?: MouseEventHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Overflow = defineComponent({
|
|
||||||
name: 'Overflow',
|
|
||||||
inheritAttrs: false,
|
|
||||||
props: {
|
|
||||||
id: String,
|
id: String,
|
||||||
prefixCls: String,
|
prefixCls: String,
|
||||||
data: Array,
|
data: Array,
|
||||||
|
@ -67,7 +39,14 @@ const Overflow = defineComponent({
|
||||||
/** When set to `full`, ssr will render full items by default and remove at client side */
|
/** When set to `full`, ssr will render full items by default and remove at client side */
|
||||||
ssr: String as PropType<'full'>,
|
ssr: String as PropType<'full'>,
|
||||||
onMousedown: Function as PropType<MouseEventHandler>,
|
onMousedown: Function as PropType<MouseEventHandler>,
|
||||||
},
|
};
|
||||||
|
};
|
||||||
|
type InterOverflowProps = Partial<ExtractPropTypes<ReturnType<typeof overflowProps>>>;
|
||||||
|
export type OverflowProps = HTMLAttributes & InterOverflowProps;
|
||||||
|
const Overflow = defineComponent<OverflowProps>({
|
||||||
|
name: 'Overflow',
|
||||||
|
inheritAttrs: false,
|
||||||
|
props: overflowProps() as any,
|
||||||
emits: ['visibleChange'],
|
emits: ['visibleChange'],
|
||||||
setup(props, { attrs, emit }) {
|
setup(props, { attrs, emit }) {
|
||||||
const fullySSR = computed(() => props.ssr === 'full');
|
const fullySSR = computed(() => props.ssr === 'full');
|
||||||
|
|
Loading…
Reference in New Issue