ShortPassword 짧은 비밀번호
ShortPassword는 비밀번호나 SMS 인증 코드 입력에 쓰는 짧은 비밀번호 입력 박스 컴포넌트예요.
출처: 문서
본문
설치
ShortPassword와 함께 자판으로 쓰는 NumberKeyboard도 앱에 등록해요.
import { createApp } from 'vue'
import { ShortPassword, NumberKeyboard } from '@nutui/nutui'
const app = createApp()
app.use(ShortPassword)
app.use(NumberKeyboard)
사용 예시
기본 사용법
demo: shortpassword basic
비밀번호 길이 커스터마이즈
demo: shortpassword length
비밀번호 찾기
demo: shortpassword forget
에러 메시지
demo: shortpassword error
API
Props
| Attribute | Description | Type | Default |
|---|---|---|---|
| v-model | Current value | string | |
| v-model:visible | Whether to show shortpassword | boolean | false |
| title | title | string | Please enter password |
| desc | description | string | Verify |
| tips | Bottom right prompt | string | Forget password |
| close-on-click-overlay | Click to close the mask | boolean | true |
| length | ShortPassword lenght The value is 4~6 | string | number | 6 |
| error-msg | Error message | string | '' |
Events
| Event | Description | Arguments |
|---|---|---|
| close | Trigger an event when the close icon is clicked | - |
| complete | Input complete callback | value:string |
| focus | Emitted when input is focused | - |
Theming
CSS Variables
스타일 커스텀에 쓸 수 있는 CSS 변수를 제공해요. 자세한 내용은 ConfigProvider 컴포넌트를 참고하세요.
| Name | Default Value |
|---|---|
| --nut-shortpassword-background-color | rgba(245, 245, 245, 1) |
| --nut-shortpassword-border-color | #ddd |
| --nut-shortpassword-error | var(--nut-primary-color) |
| --nut-shortpassword-forget | rgba(128, 128, 128, 1) |
더 알아보기 (Learn more)
- 원문 문서: NutUI ShortPassword 공식 문서(영문)
- NutUI는 JD.com이 공개한 Vue 3 모바일 컴포넌트 라이브러리예요. 전체 컴포넌트 목록은 공식 문서 사이트에서, 소스 코드는 GitHub 저장소에서 볼 수 있어요.