|
4 | 4 | </div> |
5 | 5 | </template> |
6 | 6 |
|
7 | | -<script type='text/ecmascript-6'> |
| 7 | +<script type="text/ecmascript-6"> |
8 | 8 | import Utils from '../../utils'; |
9 | 9 | const dotCircleImg = require('../../assets/dot-circle.png'); |
10 | 10 | const rotateMdrImg = require('../../assets/rotate-mdr.png'); |
11 | 11 | export default { |
12 | 12 | name: 'VueFabric', |
13 | 13 | props: { |
14 | 14 | id: { |
15 | | - type: String, |
16 | | - required: false, |
17 | | - default: 'fabricCanvas', |
| 15 | + type: String, |
| 16 | + required: false, |
| 17 | + default: 'fabricCanvas' |
18 | 18 | }, |
19 | 19 | width: { |
20 | 20 | type: Number, |
@@ -225,7 +225,7 @@ export default { |
225 | 225 | return path; |
226 | 226 | }, |
227 | 227 | freeDrawConfig (options) { |
228 | | - options = Object.assign({color:'#b2b2b2',drawWidth:2},options); |
| 228 | + options = Object.assign({color: '#b2b2b2', drawWidth: 2}, options); |
229 | 229 |
|
230 | 230 | this.canvas.isDrawingMode = options.isDrawingMode; |
231 | 231 | this.canvas.freeDrawingBrush.color = options.color; // 设置自由绘颜色 |
@@ -571,15 +571,15 @@ export default { |
571 | 571 | // 设置mirror |
572 | 572 | toggleMirror (options) { |
573 | 573 | options = options || {}; |
574 | | - options = Object.assign({ flip : 'X' },options); |
| 574 | + options = Object.assign({ flip: 'X' }, options); |
575 | 575 | let img = this.canvas.getActiveObject(); |
576 | 576 | // if (img && img.type == 'image') { |
577 | | - if (options.flip === 'X') { |
578 | | - img.toggle('flipX'); |
579 | | - } else { |
580 | | - img.toggle('flipY'); |
581 | | - } |
582 | | - this.renderAll(); |
| 577 | + if (options.flip === 'X') { |
| 578 | + img.toggle('flipX'); |
| 579 | + } else { |
| 580 | + img.toggle('flipY'); |
| 581 | + } |
| 582 | + this.renderAll(); |
583 | 583 | // } |
584 | 584 | }, |
585 | 585 | // 设置层级 |
@@ -637,5 +637,4 @@ export default { |
637 | 637 | }; |
638 | 638 | </script> |
639 | 639 |
|
640 | | -<style lang='scss' scoped> |
641 | | -</style> |
| 640 | +<style lang="scss" scoped></style> |
0 commit comments