fix: input type ts

pull/5094/head
tangjinzhou 2021-12-28 18:56:31 +08:00
parent 26496ba0a9
commit ca2ad60aef
1 changed files with 26 additions and 22 deletions

View File

@ -2,6 +2,7 @@ import type { ExtractPropTypes, PropType } from 'vue';
import PropTypes from '../_util/vue-types'; import PropTypes from '../_util/vue-types';
import type { SizeType } from '../config-provider'; import type { SizeType } from '../config-provider';
import omit from '../_util/omit'; import omit from '../_util/omit';
import type { LiteralUnion } from '../_util/type';
export const inputDefaultValue = Symbol() as unknown as string; export const inputDefaultValue = Symbol() as unknown as string;
const inputProps = { const inputProps = {
id: PropTypes.string, id: PropTypes.string,
@ -18,28 +19,31 @@ const inputProps = {
autocomplete: String, autocomplete: String,
type: { type: {
type: String as PropType< type: String as PropType<
| 'button' LiteralUnion<
| 'checkbox' | 'button'
| 'color' | 'checkbox'
| 'date' | 'color'
| 'datetime-local' | 'date'
| 'email' | 'datetime-local'
| 'file' | 'email'
| 'hidden' | 'file'
| 'image' | 'hidden'
| 'month' | 'image'
| 'number' | 'month'
| 'password' | 'number'
| 'radio' | 'password'
| 'range' | 'radio'
| 'reset' | 'range'
| 'search' | 'reset'
| 'submit' | 'search'
| 'tel' | 'submit'
| 'text' | 'tel'
| 'time' | 'text'
| 'url' | 'time'
| 'week' | 'url'
| 'week',
string
>
>, >,
default: 'text', default: 'text',
}, },