npm install vue-esign --save
在main.js中引入
import vueEsign from 'vue-esign'
Vue.use(vueEsign)
<div class="box"><vue-esignclass="back"ref="esign":width="500":height="400":isCrop="isCrop":lineWidth="lineWidth":lineColor="lineColor":bgColor.sync="bgColor"/><imgclass="img":src="resultImg"alt=""/></div><button @click="handleReset">清空画板</button><button @click="handleGenerate">生成图片</button>
export default {name: 'HelloWorld',data () {return {lineWidth: 3,lineColor: 'red',bgColor: '',resultImg: '',isCrop: false}},methods: {handleReset () {this.$set()sultImg = ''},handleGenerate () {this.$ate().then(res => {console.log(sultImg = res}).catch(err => {console.log(err)})}},
}
github地址:
本文发布于:2024-02-05 05:17:21,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170725022063369.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |