添加 cl-sign 签名组件

This commit is contained in:
icssoa
2025-07-29 10:44:18 +08:00
parent d6da3d768c
commit 28a6627224
16 changed files with 470 additions and 9 deletions

View File

@@ -0,0 +1,48 @@
<template>
<cl-page>
<cl-sign
ref="signRef"
:width="windowWidth"
:fullscreen="isFullscreen"
:enable-brush="isBrush"
></cl-sign>
<view class="p-3">
<cl-list>
<cl-list-item label="操作">
<cl-button type="info" @click="clear">清空</cl-button>
<cl-button @click="preview">预览</cl-button>
</cl-list-item>
<cl-list-item label="全屏">
<cl-switch v-model="isFullscreen"></cl-switch>
</cl-list-item>
<cl-list-item label="毛笔效果">
<cl-switch v-model="isBrush"></cl-switch>
</cl-list-item>
</cl-list>
</view>
</cl-page>
</template>
<script setup lang="ts">
import { ref } from "vue";
import DemoItem from "../components/item.uvue";
const { windowWidth } = uni.getWindowInfo();
const isFullscreen = ref(false);
const isBrush = ref(true);
const signRef = ref<ClSignComponentPublicInstance | null>(null);
function clear() {
signRef.value?.clear();
}
function preview() {
signRef.value?.toPng().then((res) => {
console.log(res);
});
}
</script>

View File

@@ -357,6 +357,11 @@ const data = computed<Item[]>(() => {
icon: "qr-code-line",
path: "/pages/demo/other/qrcode"
},
{
label: "签名",
icon: "sketching",
path: "/pages/demo/other/sign"
},
{
label: "DayUts",
icon: "timer-2-line",