diff --git a/components/list/Item.tsx b/components/list/Item.tsx index d6092df08..7d5363b97 100644 --- a/components/list/Item.tsx +++ b/components/list/Item.tsx @@ -6,7 +6,7 @@ import { cloneElement } from '../_util/vnode'; import { defineComponent, inject, ref } from 'vue'; import ItemMeta from './ItemMeta'; import useConfigInject from '../_util/hooks/useConfigInject'; -import { ListContextKey } from '.'; +import { ListContextKey } from './contextKey'; export const ListItemProps = { prefixCls: PropTypes.string, diff --git a/components/list/contextKey.ts b/components/list/contextKey.ts new file mode 100644 index 000000000..d81dac13a --- /dev/null +++ b/components/list/contextKey.ts @@ -0,0 +1,8 @@ +import type { InjectionKey, Ref } from 'vue'; + +export interface ListContext { + grid?: Ref; + itemLayout?: Ref; +} + +export const ListContextKey: InjectionKey = Symbol('ListContextKey'); diff --git a/components/list/index.tsx b/components/list/index.tsx index c31333b92..d5bf8a26e 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -1,4 +1,4 @@ -import type { App, Plugin, ExtractPropTypes, PropType, InjectionKey, Ref } from 'vue'; +import type { App, Plugin, ExtractPropTypes, PropType } from 'vue'; import { provide, defineComponent, ref, watch, computed, toRef } from 'vue'; import PropTypes, { withUndefined } from '../_util/vue-types'; import type { RenderEmptyHandler } from '../config-provider'; @@ -70,12 +70,7 @@ export interface ListLocale { export type ListProps = Partial>; -export interface ListContext { - grid?: Ref; - itemLayout?: Ref; -} - -export const ListContextKey: InjectionKey = Symbol('ListContextKey'); +import { ListContextKey } from './contextKey'; const List = defineComponent({ name: 'AList',