File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div >
3- <canvas id =" canvas " :width =" width" :height =" height" ></canvas >
3+ <canvas : id =" id " :width =" width" :height =" height" ></canvas >
44 </div >
55</template >
66
@@ -11,6 +11,10 @@ const rotateMdrImg = require('../../assets/rotate-mdr.png');
1111export default {
1212 name: ' VueFabric' ,
1313 props: {
14+ id: {
15+ type: String ,
16+ default: ' canvas' ,
17+ },
1418 width: {
1519 type: Number ,
1620 required: true
@@ -221,7 +225,7 @@ export default {
221225 },
222226 freeDrawConfig (options ) {
223227 options = Object .assign ({color: ' #b2b2b2' ,drawWidth: 2 },options);
224-
228+
225229 this .canvas .isDrawingMode = options .isDrawingMode ;
226230 this .canvas .freeDrawingBrush .color = options .color ; // 设置自由绘颜色
227231 this .canvas .freeDrawingBrush .width = options .drawWidth ;
@@ -631,4 +635,4 @@ export default {
631635 </script >
632636
633637<style lang='scss' scoped>
634- </style >
638+ </style >
You can’t perform that action at this time.
0 commit comments