zydx-plus 1.30.149 → 1.30.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="sketchpad">
|
|
3
|
-
<canvas id="
|
|
3
|
+
<canvas :id="id"></canvas>
|
|
4
4
|
<div class="tool">
|
|
5
5
|
<div class="tool-list" @click="set">
|
|
6
6
|
<img src="./img/shezi.png" alt="" />
|
|
@@ -76,7 +76,8 @@ export default {
|
|
|
76
76
|
strokeColor: ['#000','#f00','#0f0','#00f','#f0f','#ff0','#0ff'], // 画笔颜色
|
|
77
77
|
textShow: false, // 文本
|
|
78
78
|
textData: ['14','16','18','20','22','24','28','30'], // 文本数据
|
|
79
|
-
text: ''
|
|
79
|
+
text: '',
|
|
80
|
+
id: null
|
|
80
81
|
}
|
|
81
82
|
},
|
|
82
83
|
props: {
|
|
@@ -103,7 +104,11 @@ export default {
|
|
|
103
104
|
}
|
|
104
105
|
},
|
|
105
106
|
mounted() {
|
|
106
|
-
|
|
107
|
+
// 生成随机id
|
|
108
|
+
this.id = Math.random().toString(36).substr(2)
|
|
109
|
+
setTimeout(() => {
|
|
110
|
+
this.init()
|
|
111
|
+
},0)
|
|
107
112
|
window.addEventListener('keydown', this.handleKeyEvent)
|
|
108
113
|
},
|
|
109
114
|
beforeDestroy() {
|
|
@@ -129,7 +134,7 @@ export default {
|
|
|
129
134
|
this.setShow = !this.setShow
|
|
130
135
|
},
|
|
131
136
|
init() {
|
|
132
|
-
this.canvas = new fabric.Canvas(
|
|
137
|
+
this.canvas = new fabric.Canvas(this.id, {
|
|
133
138
|
isDrawingMode: false,
|
|
134
139
|
width: this.width,
|
|
135
140
|
height: this.height,
|