| | |
| | | <!-- 涂色连线题控件 --> |
| | | <template> |
| | | <div class="page"> |
| | | <div class="page" :style="{height:imgHeight + 120 + 'px'}"> |
| | | <div class="main"> |
| | | <div id="canvas_panel"> |
| | | <canvas |
| | |
| | | }, |
| | | bcImg:{ |
| | | type:String |
| | | }, |
| | | imgWidth:{ |
| | | type:Number |
| | | }, |
| | | imgHeight:{ |
| | | type:Number |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | imgData.setAttribute('crossOrigin', ''); |
| | | } |
| | | imgData.onload = () => { |
| | | this.context.drawImage(imgData,0,0) |
| | | this.context.drawImage(imgData,0,0,this.imgWidth,this.imgHeight) |
| | | } |
| | | } |
| | | resetCanvas(); |
| | |
| | | imgData.setAttribute('crossOrigin', ''); |
| | | } |
| | | imgData.onload = () => { |
| | | this.context.drawImage(imgData,0,0) |
| | | this.context.drawImage(imgData,0,0,this.imgWidth,this.imgHeight) |
| | | } |
| | | }, |
| | | // 保存画布背景和划线到本地方法 |
| | |
| | | display: flex; |
| | | flex-direction: column; |
| | | width:100%; |
| | | height: 866px; |
| | | } |
| | | |
| | | .main { |