서명
서명 (Signature)
canvas 기반으로 만들어진 서명(사인) 컴포넌트예요. 화면에 직접 그려서 서명을 받고, 결과를 이미지 데이터로 넘겨 줘요. 선 색상과 굵기도 바꿀 수 있어요.
출처: 문서
본문
설치 (Install)
import { createApp } from 'vue'
import { Signature } from '@nutui/nutui'
const app = createApp()
app.use(Signature)
사용 예제 (Usage)
기본 사용법 (Basic usage)
demo: signature basic
색상과 굵기 바꾸기 (Modify color and signature thickness)
demo: signature custom
API
Props
| Attribute | Description | Type | Default |
|---|---|---|---|
| custom-class | custom class |
string | - |
| line-width | line width | number | 3 |
| stroke-style | drawing stroke color | string | #000 |
| type | image format | string | png |
| un-support-tpl | Display copy when Canvas is not supported | string | Sorry, the current browser does not support Canvas, so this control cannot be used! |
Events
| Event | Description | Arguments |
|---|---|---|
| start | Signature start callback function (refers to the start of a certain stroke) | - |
| signing | The callback function that is signing (referring to a certain stroke in progress) | event |
| end | Signature end callback function (referring to the end of a certain stroke) | - |
| confirm | Click the confirm button to trigger the event callback function | canvas and signature image display data URI,<br>If not drawn, returns a tooltip and an empty data URI |
| clear | Click the re-sign button to trigger the event callback function | - |
더 알아보기 (Learn more)
이 글은 NutUI 공식 문서의 영문 원문을 한국어로 번역한 내용이에요. 최신 내용과 전체 문서는 아래 링크에서 확인할 수 있어요:
- 원문 문서: signature doc.en-US.md
- NutUI GitHub 저장소: https://github.com/jd-opensource/nutui