PasswordInput 密码输入框

引入

  1. <van-password-input
  2. :value="value"
  3. info="密码为 6 位数字"
  4. @focus="showKeyboard = true"
  5. />
  6. <!-- 数字键盘 -->
  7. <van-number-keyboard
  8. :show="showKeyboard"
  9. @input="onInput"
  10. @delete="onDelete"
  11. @blur="showKeyboard = false"
  12. />

自定义长度

  1. :value="value"
  2. :length="4"
  3. :gutter="15"
  4. :focused="showKeyboard"
  5. />

错误提示

  1. <!-- 密码输入框 -->
  2. <van-password-input
  3. :value="value"
  4. :error-info="errorInfo"
  5. :focused="showKeyboard"
  6. @focus="showKeyboard = true"
  7. <!-- 数字键盘 -->
  8. <van-number-keyboard
  9. :show="showKeyboard"
  10. @input="onInput"
  11. @delete="onDelete"
  12. @blur="showKeyboard = false"

API

Events

事件名说明回调参数
focus输入框聚焦时触发-