perf(descriptions): split type.ts file (#2447)

* perf(descriptions): split type.ts file

* fix: add type
This commit is contained in:
kooriookami 2021-07-06 10:16:25 +08:00 committed by GitHub
parent c34ffaa386
commit 3d161f785a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 10 deletions

View File

@ -1,7 +1,7 @@
import { defineComponent, h, inject } from 'vue'
import { addUnit } from '@element-plus/utils/util'
import { getNormalizedProps } from '@element-plus/utils/vnode'
import { elDescriptionsKey } from './descriptions.type'
import { elDescriptionsKey } from './token'
import type { VNode } from 'vue'
import type { IDescriptionsInject, IDescriptionsItemInject } from './descriptions.type'

View File

@ -30,7 +30,8 @@
<script lang="ts">
import { defineComponent, inject } from 'vue'
import DescriptionsCell from './descriptions-cell'
import { elDescriptionsKey } from './descriptions.type'
import { elDescriptionsKey } from './token'
import type { IDescriptionsInject } from './descriptions.type'
export default defineComponent({

View File

@ -1,4 +1,4 @@
import { InjectionKey, PropType } from 'vue'
import type { PropType } from 'vue'
interface IDescriptionsInject {
border: boolean
@ -9,8 +9,6 @@ interface IDescriptionsInject {
extra: string
}
const elDescriptionsKey: InjectionKey<IDescriptionsInject> = 'elDescriptions' as any
interface IDescriptionsItemInject {
label: string
span: number
@ -22,11 +20,7 @@ interface IDescriptionsItemInject {
labelClassName: string
}
const elDescriptionsItemKey: InjectionKey<IDescriptionsItemInject> = 'elDescriptionsItem' as any
export {
IDescriptionsInject,
elDescriptionsKey,
IDescriptionsItemInject,
elDescriptionsItemKey,
}

View File

@ -26,7 +26,7 @@ import { computed, defineComponent, provide } from 'vue'
import { isValidComponentSize } from '@element-plus/utils/validators'
import DescriptionsRow from './descriptions-row.vue'
import { useGlobalConfig } from '@element-plus/utils/util'
import { elDescriptionsKey } from './descriptions.type'
import { elDescriptionsKey } from './token'
import type { PropType } from 'vue'

View File

@ -0,0 +1,4 @@
import { InjectionKey } from 'vue'
import { IDescriptionsInject } from './descriptions.type'
export const elDescriptionsKey: InjectionKey<IDescriptionsInject> = 'elDescriptions' as any