@@ -167,6 +167,41 @@ const value14 = ref('')
167167}
168168 </style >
169169```
170+ ### inputmode Demo
171+
172+ The ` inputmode ` attribute is used to control the type of virtual keyboard on mobile devices, providing a better user experience.
173+
174+ ``` html
175+ <script setup >
176+ import { ref } from ' vue'
177+ import { useTranslation } from ' @varlet/ui'
178+
179+ const { t } = useTranslation ()
180+ const inputmodeDecimal = ref (' ' )
181+ const inputmodeNumeric = ref (' ' )
182+ const inputmodeEmail = ref (' ' )
183+ </script >
184+
185+ <template >
186+ <app-type style =" margin-top : 10vmin " >{{ t('inputmodeDemo') }}</app-type >
187+ <var-space direction =" column" :size =" ['3vmin', 0]" >
188+ <var-input v-model =" inputmodeDecimal" inputmode =" decimal" :placeholder =" t('inputmodeDecimal')" />
189+ <var-input v-model =" inputmodeNumeric" inputmode =" numeric" :placeholder =" t('inputmodeNumeric')" />
190+ <var-input v-model =" inputmodeEmail" inputmode =" email" :placeholder =" t('inputmodeEmail')" />
191+ </var-space >
192+ </template >
193+ ```
194+
195+ #### inputmode Options
196+
197+ - ` decimal ` : Display a numeric keypad with decimal point
198+ - ` numeric ` : Display a pure numeric keypad
199+ - ` email ` : Display a keyboard optimized for email input
200+ - ` tel ` : Display a telephone number keypad
201+ - ` url ` : Display a keyboard optimized for URL input
202+ - ` search ` : Display a search-optimized keyboard
203+ - ` text ` : Display a standard text keyboard (default)
204+
170205
171206## API
172207
@@ -272,10 +307,4 @@ Here are the CSS variables used by the component. Styles can be customized using
272307| ` --input-input-font-size ` | ` 16px ` |
273308| ` --input-textarea-height ` | ` auto ` |
274309
275- ### inputmode Demo
276310
277- ``` html
278- <var-input inputmode =" decimal" placeholder =" inputmode=decimal" />
279- <var-input inputmode =" numeric" placeholder =" inputmode=numeric" />
280- <var-input inputmode =" email" placeholder =" inputmode=email" />
281- ```
0 commit comments