mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 11:17:46 +08:00
refactor(components): [input] fix ts error (#8200)
This commit is contained in:
parent
0c597a63ef
commit
bf2d671142
@ -80,7 +80,7 @@
|
||||
<el-icon
|
||||
v-if="showClear"
|
||||
:class="[nsInput.e('icon'), nsInput.e('clear')]"
|
||||
@mousedown.prevent
|
||||
@mousedown.prevent="NOOP"
|
||||
@click="clear"
|
||||
>
|
||||
<circle-close />
|
||||
@ -174,6 +174,7 @@ import {
|
||||
View as IconView,
|
||||
} from '@element-plus/icons-vue'
|
||||
import {
|
||||
NOOP,
|
||||
ValidateComponentsMap,
|
||||
debugWarn,
|
||||
isKorean,
|
||||
@ -210,8 +211,8 @@ const instance = getCurrentInstance()!
|
||||
const rawAttrs = useRawAttrs()
|
||||
const slots = useSlots()
|
||||
|
||||
const containerAttrs = computed<Record<string, unknown>>(() => {
|
||||
const comboBoxAttrs = {}
|
||||
const containerAttrs = computed(() => {
|
||||
const comboBoxAttrs: Record<string, unknown> = {}
|
||||
if (props.containerRole === 'combobox') {
|
||||
comboBoxAttrs['aria-haspopup'] = rawAttrs['aria-haspopup']
|
||||
comboBoxAttrs['aria-owns'] = rawAttrs['aria-owns']
|
||||
@ -248,7 +249,9 @@ const _ref = computed(() => input.value || textarea.value)
|
||||
|
||||
const needStatusIcon = computed(() => form?.statusIcon ?? false)
|
||||
const validateState = computed(() => formItem?.validateState || '')
|
||||
const validateIcon = computed(() => ValidateComponentsMap[validateState.value])
|
||||
const validateIcon = computed(
|
||||
() => validateState.value && ValidateComponentsMap[validateState.value]
|
||||
)
|
||||
const passwordIcon = computed(() =>
|
||||
passwordVisible.value ? IconView : IconHide
|
||||
)
|
||||
|
@ -9,6 +9,7 @@ import type {
|
||||
FormEmits,
|
||||
FormItemProp,
|
||||
FormItemProps,
|
||||
FormItemValidateState,
|
||||
FormLabelWidthContext,
|
||||
FormProps,
|
||||
} from '@element-plus/components/form'
|
||||
@ -47,7 +48,7 @@ export type FormContext = FormProps &
|
||||
export interface FormItemContext extends FormItemProps {
|
||||
$el: HTMLDivElement | undefined
|
||||
size: ComponentSize
|
||||
validateState: string
|
||||
validateState: FormItemValidateState
|
||||
isGroup: boolean
|
||||
labelId: string
|
||||
inputIds: string[]
|
||||
|
Loading…
Reference in New Issue
Block a user