Skip to content

Commit

Permalink
fix: (input) 小程序部分type 属性失效
Browse files Browse the repository at this point in the history
  • Loading branch information
yang1206 committed Aug 7, 2023
1 parent 3da998a commit a88fa69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nutui/components/input/input.vue
Expand Up @@ -40,12 +40,13 @@ const styles: ComputedRef = computed(() => {
})
function inputType(type: InputType) {
// #ifdef H5
if (type === 'number')
return 'text'
if (type === 'digit')
return 'tel'
// #endif
return type
}
Expand Down
4 changes: 4 additions & 0 deletions packages/nutui/components/input/type.ts
Expand Up @@ -25,7 +25,11 @@ export type InputType =
| 'password'
| 'textarea'
| 'datetime-local'
| 'idcard'
| 'safe-password'
| 'text' | 'number' | 'idcard' | 'digit' | 'tel' | 'safe-password' | 'nickname'

export type UniInputType = 'text' | 'number' | 'idcard' | 'digit' | 'tel' | 'safe-password' | 'nickname'
export interface InputRule {
pattern?: RegExp
message?: string
Expand Down

0 comments on commit a88fa69

Please sign in to comment.