首页需要下载依赖包
npm install --save vue-signature-pad
这里使用的是全局引用组件在main.js中
import Vue from "vue";
<--引入-->
import VueSignaturePad from "vue-signature-pad";
<--注册组件->
Vue.use(VueSignaturePad);
在页面中使用组件
<vue-signature-pad
id="signature"
width="95%"
height="400px"
ref="signaturePad"
:options="options"
/>
<el-row>
<el-col :span="4">
<div class="grid-content bg-purple">
<el-button type="primary" plain @click="undo">撤销</el-button>