1.0.11 • Published 5 months ago

vue-perfect-signature v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

vue-perfect-signature/手写签名

Practical Vue handwritten signature component.

实用的vue手写签名组件。

🔗 Curious? Try out a demo.

Installation

npm install vue-perfect-signature

Introduction

  • Only supports mobile devices // 仅支持移动设备
  • Even when the screen is locked, it is also forced to display horizontally. // 锁屏情况下,也强制横屏显示
  • Prevent the vue-perfect-signature toolbar from safari and chrome. When the title bar slides, it will pull down to refresh the page. // 阻止在safari,chrome里在vue-perfect-signature工具栏,标题栏滑动会下拉刷新页面

Screenshot

Usage

install component

import VuePerfectSignature from "vue-perfect-signature";
import "vue-perfect-signature/lib/style.css";

const app = createApp(App);

app.use(VuePerfectSignature.install);

use vue-perfect-signature component

<template>
  <img
    :src="signatureImgSrc"
    alt="signature preview"
  />
  <Teleport v-if="isShow" to="body" >
    <vue-perfect-signature
      @save="handleSave"
      @close="isShow=false"
    />
  </Teleport>
</template>

<script>
export default {
  data() { return { isShow: true } }
  methods: {
    handleSave({ base64 }) {
      this.signatureImgSrc = base64
    }
  }
}
</script>

Example

demo.

Documentation

Attributes

PropertyTypeDefaultDescription
drawOptionsObjectDepends on perfect-freehand, so refer to its options

Events

PropertyTypeDefaultDescription
@save({ base64 })=>void
@close()=>void

Slots

NameTypeDefaultDescription
topBar({ base64 })=>void

Discussion

issues

License

  • MIT

Author

1.0.11

5 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago