fix(input): autosize type problem (#3008) (#3012)

* fix(input): autosize type problem (#3008)

* fix(input/card):  ( autosize/bodyStyle )type problem (#3008)

* fix(input/card): (autosize/bodyStyle)type problem (#3008)

* fix(components): input/card (autosize/bodyStyle) type problem (#3008)

* fix(components): input/card (autosize/bodyStyle) type problem (#3008)
This commit is contained in:
SongWuKong 2021-08-26 17:00:18 +08:00 committed by GitHub
parent 5f33956b76
commit 7b79aae8ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 6 deletions

View File

@ -10,6 +10,8 @@
</template>
<script lang='ts'>
import { defineComponent } from 'vue'
import type { PropType } from 'vue'
import type { StyleValue } from '@element-plus/utils/types'
export default defineComponent({
name: 'ElCard',
@ -19,8 +21,8 @@ export default defineComponent({
default: '',
},
bodyStyle: {
type: [String, Object, Array],
default: '',
type: [String, Object, Array] as PropType<StyleValue>,
default: '' as StyleValue,
},
shadow: {
type: String,

View File

@ -167,7 +167,7 @@ export default defineComponent({
},
autosize: {
type: [Boolean, Object] as PropType<AutosizeProp>,
default: false,
default: false as AutosizeProp,
},
autocomplete: {
type: String,

View File

@ -1,7 +1,8 @@
import { isNumber } from '@element-plus/utils/util'
import type { PropType } from 'vue'
import type { Direction, LayoutDirection, StyleValue, ItemSize } from './types'
import type { Direction, LayoutDirection, ItemSize } from './types'
import type { StyleValue } from '@element-plus/utils/types'
export const DEFAULT_DYNAMIC_LIST_ITEM_SIZE = 50

View File

@ -5,7 +5,6 @@ import type {
} from 'vue'
export type Instance = ComponentInternalInstance
export type StyleValue = string | CSSProperties | Array<StyleValue>
export type ScrollEvent = WheelEvent | MouseEvent
export type Alignment = 'auto' | 'smart' | 'center' | 'start' | 'end'

View File

@ -1,4 +1,4 @@
import type { Plugin } from 'vue'
import type { CSSProperties, Plugin } from 'vue'
type OptionalKeys<T extends Record<string, unknown>> = {
[K in keyof T]: T extends Record<K, T[K]>
@ -36,3 +36,5 @@ export type Hash<T> = Indexable<T>
export type TimeoutHandle = ReturnType<typeof global.setTimeout>
export type ComponentSize = 'large' | 'medium' | 'small' | 'mini'
export type StyleValue = string | CSSProperties | Array<StyleValue>