mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-05 04:37:47 +08:00
perf(descriptions): split type.ts file (#2447)
* perf(descriptions): split type.ts file * fix: add type
This commit is contained in:
parent
c34ffaa386
commit
3d161f785a
@ -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'
|
||||
|
@ -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({
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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'
|
||||
|
||||
|
4
packages/descriptions/src/token.ts
Normal file
4
packages/descriptions/src/token.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { InjectionKey } from 'vue'
|
||||
import { IDescriptionsInject } from './descriptions.type'
|
||||
|
||||
export const elDescriptionsKey: InjectionKey<IDescriptionsInject> = 'elDescriptions' as any
|
Loading…
Reference in New Issue
Block a user