fix(List): fix circular reference, which confuses vite (#4263) (#4283)

chore-vite
Carter Li 2021-06-28 17:45:04 +08:00 committed by GitHub
parent cdbe8eea6b
commit e2ea50f08e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 8 deletions

View File

@ -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,

View File

@ -0,0 +1,8 @@
import type { InjectionKey, Ref } from 'vue';
export interface ListContext {
grid?: Ref<any>;
itemLayout?: Ref<string>;
}
export const ListContextKey: InjectionKey<ListContext> = Symbol('ListContextKey');

View File

@ -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<ExtractPropTypes<typeof listProps>>;
export interface ListContext {
grid?: Ref<any>;
itemLayout?: Ref<string>;
}
export const ListContextKey: InjectionKey<ListContext> = Symbol('ListContextKey');
import { ListContextKey } from './contextKey';
const List = defineComponent({
name: 'AList',