@zhangqingcq/vgce 0.1.33 → 0.1.35
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/dist/style.css +1 -1
- package/dist/vgce.js +5 -4
- package/dist/vgce.umd.cjs +1 -1
- package/package.json +1 -1
- package/src/components/svg-viewer.vue +7 -2
package/package.json
CHANGED
|
@@ -35,10 +35,12 @@
|
|
|
35
35
|
vueComp?: Record<string, any>
|
|
36
36
|
data?: IDataModel
|
|
37
37
|
canvasDrag?: boolean
|
|
38
|
+
canvasZoom?: boolean
|
|
38
39
|
showCanvasInfo?: boolean
|
|
39
40
|
}>(),
|
|
40
41
|
{
|
|
41
42
|
canvasDrag: true,
|
|
43
|
+
canvasZoom: true,
|
|
42
44
|
showCanvasInfo: true
|
|
43
45
|
}
|
|
44
46
|
)
|
|
@@ -139,6 +141,9 @@
|
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
function onMousewheel(e: any) {
|
|
144
|
+
if (!props.canvasZoom) {
|
|
145
|
+
return
|
|
146
|
+
}
|
|
142
147
|
if (e?.wheelDelta) {
|
|
143
148
|
if (e.wheelDelta > 0) {
|
|
144
149
|
preview_data.config.svg.scale = myFixed(preview_data.config.svg.scale + 0.1, 1)
|
|
@@ -294,8 +299,8 @@
|
|
|
294
299
|
}
|
|
295
300
|
if (m && m.url && m.user && m.pwd && m.topics) {
|
|
296
301
|
link.sub(m.url, m.user, m.pwd, m.topics, (topics: string, message: string) => {
|
|
297
|
-
console.log(topics)
|
|
298
|
-
console.log(message.toString())
|
|
302
|
+
// console.log(topics)
|
|
303
|
+
// console.log(message.toString())
|
|
299
304
|
//暴露给外部,让用户自己处理消息,message可以用JSON.parse解析成对象(后端推给前端的MQTT消息内容需要是JSON格式)
|
|
300
305
|
//用户拿到消息后可以配合setNodeAttrByID方法更新界面
|
|
301
306
|
//setNodeAttrByID的参数id可以在传给本组件的props.data(用户传进来的,自然知道值是多少)里done_json找到
|