Skip to content

Feat/inputmode support#1916

Closed
william-xue wants to merge 43 commits into
varletjs:devfrom
william-xue:feat/inputmode-support
Closed

Feat/inputmode support#1916
william-xue wants to merge 43 commits into
varletjs:devfrom
william-xue:feat/inputmode-support

Conversation

@william-xue

Copy link
Copy Markdown
Member

Checklist

List of tasks you have already done and plan to do.

  • Fix linting errors
  • Tests have been added / updated (or snapshots)

Change information

Describe your modifications here.

Issues

The issues you want to close, formatted as close #1900.

Related Links

Links related to this pr.

@vercel

vercel Bot commented Jul 2, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
varlet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 10, 2025 8:45am

@vercel

vercel Bot commented Jul 2, 2025

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the varletjs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Jul 2, 2025

Copy link
Copy Markdown

Open in StackBlitz

@varlet/cli

npm i https://pkg.pr.new/@varlet/cli@1916

@varlet/icons

npm i https://pkg.pr.new/@varlet/icons@1916

@varlet/import-resolver

npm i https://pkg.pr.new/@varlet/import-resolver@1916

@varlet/preset-tailwindcss

npm i https://pkg.pr.new/@varlet/preset-tailwindcss@1916

@varlet/preset-unocss

npm i https://pkg.pr.new/@varlet/preset-unocss@1916

@varlet/shared

npm i https://pkg.pr.new/@varlet/shared@1916

@varlet/touch-emulator

npm i https://pkg.pr.new/@varlet/touch-emulator@1916

@varlet/ui

npm i https://pkg.pr.new/@varlet/ui@1916

@varlet/use

npm i https://pkg.pr.new/@varlet/use@1916

@varlet/vite-plugins

npm i https://pkg.pr.new/@varlet/vite-plugins@1916

commit: c965f9e

Comment thread packages/varlet-ui/src/input/Input.vue Outdated
Comment thread packages/varlet-ui/src/input/Input.vue Outdated
:rows="rows"
:enterkeyhint="enterkeyhint"
:inputmode="type === 'number' ? 'decimal' : undefined"
:inputmode="inputmode"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是 inputmode != null ? inputmode : type === 'number' ? 'decimal' : undefined。

props: {
modelValue: 'text',
type,
inputmode: type === 'number' ? 'decimal' : undefined,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个判断就不需要了

| `rules` | Validation rules, return `true` to indicate verification passes, other types of values ​​will be converted into text as user prompts. [Zod validation](#/en-US/zodValidation) is supported since `3.5.0` | _((v: string) => any) \| ZodType \| Array<((v: string) => any) \| ZodType>_ | `-` |
| `enterkeyhint` | Customize the enter key style, See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/enterkeyhint) | _string_ | `-` |
| `aria-label` ***3.8.4*** | See [MDN](https://developer.mozilla.org/zh-CN/docs/Web/Accessibility/ARIA/Attributes/aria-label) | _string_ | `-` |
| `inputmode` | Native inputmode attribute, controls mobile keyboard type | _string_ | `-` |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add mdn inputmode link

</template>
```

#### inputmode 可选值

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it,add mdn link in inputmode prop

type: Boolean,
default: true,
},
inputmode: String as PropType<'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import this type from vue

@chouchouji

Copy link
Copy Markdown
Member

should resolve conflicts and clear commit history

@haoziqaq haoziqaq closed this Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add inputmode prop to Input component

4 participants