mand-mobile/components/input-item
Shawn Xu 0483ac7909 fix(input-item):destroy virtual keyboard before input-item will be destroyed #104 (#105) 2018-06-08 13:40:47 +08:00
..
demo Merge branch 'dev' into feature_en_doc 2018-05-30 14:15:50 +08:00
test Initial commit 2018-03-26 16:04:04 +08:00
README.en-US.md correct filed and input-item 2018-06-07 15:22:00 +08:00
README.md Merge branch 'dev' into feature_en_doc 2018-05-30 14:15:50 +08:00
component.js Initial commit 2018-03-26 16:04:04 +08:00
cursor.js Initial commit 2018-03-26 16:04:04 +08:00
index.vue fix(input-item):destroy virtual keyboard before input-item will be destroyed #104 (#105) 2018-06-08 13:40:47 +08:00
keycode.js Initial commit 2018-03-26 16:04:04 +08:00

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 HtmlFragment and slot(name: left)
placeholder placeholder of input String - -
maxlength maximum number of characters that can be entered String/Number - the maxlength of phone type 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 true when type is bankCard, phone or money, otherwise false -
formation input text formatting callback function Function(name, curValue, curPos): {value: curValue, range: curPos} - passing parameter name is the name of input, curValue is input value, curPos is the current position of input cursor, and returned value is formatted value. range is 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