|  | ||
|---|---|---|
| .. | ||
| demo | ||
| test | ||
| README.en-US.md | ||
| README.md | ||
| component.js | ||
| cursor.js | ||
| index.vue | ||
| keycode.js | ||
		
			
				
				README.en-US.md
			
		
		
			
			
		
	
	| title | preview | 
|---|---|
| InputItem | https://didi.github.io/mand-mobile/examples/#/input-item | 
Single-line text input, supports text formatting in exact scenarios
Import
import { InputItem } from 'mand-mobile'
Vue.component(InputItem.name, InputItem)
Code Examples
API
InputItem Props
| Props | Description | Type | Default | Note | 
|---|---|---|---|---|
| type | input type, special type has text formatting | String | text | text,bankCard,phone,money,password | 
| name | name of input | String | - | one of the event arguments, is used to distinguish multi inputs | 
| v-model | value of input | String | - | - | 
| title | title of input | String | - | support HtmlFragmentandslot(name: left) | 
| placeholder | placeholder of input | String | - | - | 
| maxlength | maximum number of characters that can be entered | String/Number | - | the maxlength of phonetype is fixed at 11 | 
| size | size of input | String | normal | large,normal | 
| align | text alignment | String | left | left,center,right | 
| error | error message | String | - | - | 
| readonly | readonly | Boolean | false | - | 
| disabled | disabled | Boolean | false | - | 
| is-title-latent | hide title or not | Boolean | false | title will be displayed when input is focused or content is not empty | 
| is-highlight | the input is highlighted or not | Boolean | false | only affect the font color of placeholder | 
| is-formative | if the input text is automatically formatted according to the type | Boolean | the default value is truewhentypeisbankCard,phoneormoney, otherwisefalse | - | 
| formation | input text formatting callback function | Function(name, curValue, curPos): {value: curValue, range: curPos} | - | passing parameter nameis the name of input,curValueis input value,curPosis the current position of input cursor, and returnedvalueis formatted value.rangeis the position of input cursor after formatting | 
| clearable | use clear control or not | Boolean | false | - | 
| is-virtual-keyboard | if use financial numeric keypad control | Boolean | false | - | 
| virtual-keyboard-disorder | if number keys of financial numeric keypad is out of order | Boolean | false | - | 
| virtual-keyboard-ok-text | confirmation key texts of financial numeric keypad | String | confirm | - | 
InputItem Slots
left
Left slot, generally is used to place icons, etc.
right
Right slot, generally is used to place icons, etc.
InputItem Methods
focus()
Input gets focus
blur()
Input loses focus
getValue()
Get value of input
InputItem Events
@focus(name)
Input gets focus
@blur(name)
Input loses focus
@change(name, value)
Change the value of input
@confirm(name, value)
Input value confirmation, valid only when using a financial numeric keypad or component within a form element
@keyup(name, event)
key press, is invoked only if is-virtual-keyboard is false
@keydown(name, event)
key release, is invoked only if is-virtual-keyboard is false