XInput
Install

Install


API

Props

nametypedefaultdescriptionrequired version
valuestringinput value, use v-model for binding--
typestringtextinput type, one of text,number,email,password,tel--
is-typestring
function
custom validating function, should return {valid:true} or {valid:false, msg: error msg}--
requiredbooleanfalseif is required--
titlestringlabel text--
placeholderstringplaceholder--
show-clearbooleantrueif show clear icon--
minnumberminlength for input--
maxnumbermaxlength for input--
disabledbooleanfalseif input is disabled--
readonlybooleanfalseif input is readonly--
debouncenumberdebounce time--
placeholder-alignstringleftplaceholder align valuev2.1.1-rc.8
text-alignstringlefttext-align setting for value--
label-widthstringset label width which will not be overwritten by $parent.labelWidthv2.2.1-rc.4
maskstring(beta) value mask, 9 for DIGIT, A for ALPHA, S for ALPHA AND DIGITv2.6.1
should-toast-errorstringtruewhether toast error when clicking on error iconv2.6.3

Events

nameparamsdescriptionrequired version
@on-blur(value, $event)----
@on-focus(value, $event)----
@on-enter(value, $event)----
@on-change(value)----
@on-click-error-icon(error)fires when clicking error iconv2.6.3
@on-click-clear-icon--fires when clicking clear iconv2.9.0

Slots

namedescriptionrequired version
label--
restricted-label--
right--
right-full-heightv2.8.1

Functions

nameparamsdescriptionrequired version
focusget input focus
blurremove focus from input
reset(value = '')reset input value and clear errorsv2.1.1-rc.10



Changelog

Releases

  • v2.9.2 [fix] fix corsor misplce when set mask #2810
  • v2.9.0 [fix] fix wrong valid when value is empty string #2415
  • v2.9.0 [fix] fix disabled style in iOS #2458
  • v2.9.0 [change] show clear icon only when input gets focus #2567
  • v2.9.0 [feature] add event:on-click-clear-icon #2603
  • v2.9.0 [enhance] scroll input element into view when getting focus #2604
  • v2.8.1 [feature] add slot:right-full-height for containing captcha #2475
  • v2.8.0 [fix] fix not show clear button when initial value is zero #2482
  • v2.7.9 [enhance] support china union 166 prefix phone number
  • v2.7.7 [fix] Fix error message not change bugs #2348
  • v2.7.6 [feature] add disabled class #2279
  • v2.7.4 [fix] fix ssr DOM not matched issue #2201
  • v2.7.1 [fix] fix valid is false when value is zero #2134
  • v2.7.1 [fix] fix event:on-blur not fires #2146
  • v2.6.5 [enhance] fix validating logic for is-type:china-mobile with mask #2040
  • v2.6.3 [enhance] toast error when clicking error icon #2009
  • v2.6.1 [enhance] set label for attribute #1983
  • v2.6.1 [feature] support prop:mask
  • v2.5.6 [fix] Fix is-type validating logic #1776
  • v2.5.5 [feature] Add $event param for on-focus on-blur event #1770
  • v2.5.5 [fix] Fix empty value checking logic #1759
  • v2.3.1 [feature] Add blur function #1422
  • v2.2.1-rc.4 [feature] Support labelWidth #1186
  • v2.1.1-rc.10 [feature] Support reset method #947 @erguotou520
  • v2.1.1-rc.8 [feature] Support prop:placeholder-align