vue-wiring-diagram 1.0.11 → 1.0.12
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
|
@@ -306,8 +306,8 @@ const initStencil = () => {
|
|
|
306
306
|
placeholder: '搜索',
|
|
307
307
|
notFoundText: '未找到匹配项',
|
|
308
308
|
getDragNode: (node) => {
|
|
309
|
-
const copyNode = node.clone({
|
|
310
|
-
if(copyNode.label !== '文本') {
|
|
309
|
+
const copyNode = node.clone({keepId: true})
|
|
310
|
+
if (copyNode.label !== '文本') {
|
|
311
311
|
copyNode.label = ''
|
|
312
312
|
}
|
|
313
313
|
return copyNode
|
|
@@ -349,33 +349,31 @@ const initStencil = () => {
|
|
|
349
349
|
// 添加 hover 事件监听器
|
|
350
350
|
setTimeout(() => {
|
|
351
351
|
const nodes = stencil.value.container.querySelectorAll('.x6-node');
|
|
352
|
-
nodes.forEach((node,index) => {
|
|
353
|
-
if(index > baseShape.length) {
|
|
352
|
+
nodes.forEach((node, index) => {
|
|
353
|
+
if (index > baseShape.length) {
|
|
354
354
|
const text = node.querySelector('text');
|
|
355
355
|
node.style.position = 'relative';
|
|
356
|
-
if(text) {
|
|
356
|
+
if (text) {
|
|
357
357
|
text.style.display = 'none';
|
|
358
|
-
// text 为 svg 控制位置
|
|
359
358
|
text.setAttribute('x', '0%');
|
|
360
|
-
text.setAttribute('y', '
|
|
359
|
+
text.setAttribute('y', '40');
|
|
361
360
|
text.style.fontSize = '12px';
|
|
362
|
-
text.style.fontWeight = 'bold';
|
|
363
361
|
text.style.fill = '#ffffff';
|
|
364
362
|
}
|
|
365
363
|
}
|
|
366
364
|
// 添加 hover 事件监听器
|
|
367
365
|
node.addEventListener('mouseenter', (e) => {
|
|
368
|
-
if(index > baseShape.length) {
|
|
366
|
+
if (index > baseShape.length) {
|
|
369
367
|
const text = node.querySelector('text');
|
|
370
|
-
if(text) {
|
|
368
|
+
if (text) {
|
|
371
369
|
text.style.display = 'block';
|
|
372
370
|
}
|
|
373
371
|
}
|
|
374
372
|
})
|
|
375
373
|
node.addEventListener('mouseleave', (e) => {
|
|
376
|
-
if(index > baseShape.length) {
|
|
374
|
+
if (index > baseShape.length) {
|
|
377
375
|
const text = node.querySelector('text');
|
|
378
|
-
if(text) {
|
|
376
|
+
if (text) {
|
|
379
377
|
text.style.display = 'none';
|
|
380
378
|
}
|
|
381
379
|
}
|
|
@@ -214,7 +214,7 @@ const replaceAllTemplateLiteralsWithArray = (str, replacements) => {
|
|
|
214
214
|
* \@description 画布自适应
|
|
215
215
|
*/
|
|
216
216
|
const zoomToFit = () => {
|
|
217
|
-
graph.value.zoomToFit({maxScale:
|
|
217
|
+
graph.value.zoomToFit({maxScale: 10, padding: 20})
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
const previewRef = shallowRef()
|