# PasswordInput A grid input box component that can be used for inputting passwords, SMS verification codes, and other scenarios. Usually used in conjunction with the [number keyboard](./number-keyboard.md) component. ## Basic Usage Use with the number keyboard component to implement password input functionality. ```html ``` ```typescript import { ref } from 'vue' const value = ref('123') const showKeyboard = ref(true) ``` ### Custom Length Set the password length through the `length` property. ```html ``` ### Grid Spacing Set the spacing between grids through the `gutter` property. ```html ``` ### Plain Text Display Set `mask` to `false` to display the input content in plain text, suitable for SMS verification code scenarios. ```html ``` ### Information Tips Set prompt information through the `info` property and error prompt through the `error-info` property, for example, prompting password error when six digits are entered. ```html ``` ```typescript import { ref, watch } from 'vue' const value = ref('123') const errorInfo = ref('') const showKeyboard = ref(true) watch(value, (newVal) => { if (newVal.length === 6 && newVal !== '123456') { errorInfo.value = 'Incorrect password' } else { errorInfo.value = '' } }) ``` ## Attributes | Parameter | Description | Type | Options | Default | Version | |------------|-------------|------|----------|---------|----------| | v-model | Password value | string | - | - | - | | info | Text prompt below input box | string | - | - | - | | error-info | Error prompt below input box | string | - | - | - | | length | Maximum password length | number | - | 6 | - | | gutter | Spacing between input box grids, like 20px 2em, default unit is px | number / string | - | 0 | - | | mask | Whether to hide password content | boolean | - | true | - | | focused | Whether focused, cursor will be displayed when focused | boolean | - | false | - | ## Events | Event Name | Description | Parameters | Version | |------------|-------------|------------|----------| | focus | Triggered when input box is focused | `event:Event` | - |