diff --git a/simple-mind-map/src/plugins/AssociativeLine.js b/simple-mind-map/src/plugins/AssociativeLine.js index 767785b0..a4011b62 100644 --- a/simple-mind-map/src/plugins/AssociativeLine.js +++ b/simple-mind-map/src/plugins/AssociativeLine.js @@ -213,7 +213,8 @@ class AssociativeLine { associativeLineWidth, associativeLineColor, associativeLineActiveWidth, - associativeLineActiveColor + associativeLineActiveColor, + associativeLineDasharray } = this.mindMap.themeConfig // 箭头 this.markerPath @@ -232,7 +233,7 @@ class AssociativeLine { .stroke({ width: associativeLineWidth, color: associativeLineColor, - dasharray: [6, 4] + dasharray: associativeLineDasharray || [6, 4] }) .fill({ color: 'none' }) path.plot(pathStr) @@ -331,8 +332,11 @@ class AssociativeLine { // 创建连接线 createLine(fromNode) { - let { associativeLineWidth, associativeLineColor } = - this.mindMap.themeConfig + let { + associativeLineWidth, + associativeLineColor, + associativeLineDasharray + } = this.mindMap.themeConfig if (this.isCreatingLine || !fromNode) return this.front() this.isCreatingLine = true @@ -342,7 +346,7 @@ class AssociativeLine { .stroke({ width: associativeLineWidth, color: associativeLineColor, - dasharray: [6, 4] + dasharray: associativeLineDasharray || [6, 4] }) .fill({ color: 'none' }) // 箭头 diff --git a/simple-mind-map/src/themes/default.js b/simple-mind-map/src/themes/default.js index 3b9edea0..b8e4dec1 100644 --- a/simple-mind-map/src/themes/default.js +++ b/simple-mind-map/src/themes/default.js @@ -42,6 +42,8 @@ export default { associativeLineActiveWidth: 8, // 关联线激活状态的颜色 associativeLineActiveColor: 'rgba(2, 167, 240, 1)', + // 关联线样式 + associativeLineDasharray: [6, 4], // 关联线文字颜色 associativeLineTextColor: 'rgb(51, 51, 51)', // 关联线文字大小