uni-app实现图片上传到canvas,并且图片可以移动
- 废话不多说直接上代码
<template>
<view class="container">
<!-- 海报 -->
<image src="../../static/img/pokertest.png" mode=""></image>
<canvas @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend" style="border: 1upx solid red;"
canvas-id="shareCanvas" :style="'width:'+imgWidth+'px;height:'+imgHeight+'px'"></canvas>
<!-- 海报 -->
<button class="" @tap="creat_img">
上传图片
</button>
</view>
</template>
<script>
export default {