Skip to content
你当前查看的文档是tmui3.2.0(已不再支持NVUE)
[tmui3.1.x nvue点我] [tmui4.x uniappx原生开发代替nvue]

反馈组件

签名画板 TmSignBoard

通用签名画板组件,支持手写签名功能。

🌶️ 示例

查看模拟效果
示例模板
vue
<!--
  - Copyright (c) 2025. tmzdy by @https://tmui.design
  -->
<script setup lang="ts">
import { ref } from 'vue'
const signBoardRef = ref(null)
const getimage = async ()=>{
	let org = await signBoardRef.value?.getImage();
	uni.previewImage({
		urls:[org.src],
		current:org.src
	})
}
const clear = async ()=>{
	await signBoardRef.value?.clear();
}

</script>

<template>
    <view>
        <tm-sheet>
            <tm-text font-size="32" class=" text-weight-b  d-block">签名版 TmSignBoard</tm-text>
        </tm-sheet>

        <tm-sheet >
            <tm-sheet width="660" height="660" padding="0" margin="0" color="info">
				<tm-sign-board ref="signBoardRef" width="660" height="660"></tm-sign-board>
			</tm-sheet>
			
			<view class="pa-12 flex flex-row gap-10 mt-n8">
				<tm-button @click="clear" class="flex-1">清空</tm-button>
				<tm-button @click="getimage" class="flex-1">获取图片</tm-button>
			</view>
        </tm-sheet>

    </view>

</template>

<style scoped></style>

🌶️ 兼容性

平台兼容

H5uniAPP小程序version
☑️☑️☑️☑️

🌱 参数

参数名类型默认值描述
strokeColorstring''线颜色
backgroundColorstring''线颜色
strokeWidthunion8线宽
widthunion300画布宽和高,不允许%,只能是数字或者带单位的数字如:4,'4',20px,750rpx
heightunion300画布宽和高,不允许%,只能是数字或者带单位的数字如:4,'4',20px,750rpx

🌹 事件

事件名参数返回数据描述

🌽 slot插槽

插槽名数据描述

🥗 ref方法

方法名参数返回值描述
clear--清空画布
getImage--获取签名图片
如果需投广告联系我?
TMUI4x

TMUI4x UniAppx

纯正原生开发版本,全平台原生组件,兼容鸿蒙Next原生

了解最新技术