Changelog
+
0.4.3
+
Fix: No trigger after forward and backward data_ Change event.
+
New: Support user-defined mouse wheel events; The mouse wheel is adjusted to support zooming and moving the view up and down.
0.4.2
New: The setText method of the Node class adds a second parameter to support setting rich text content.
0.4.1
diff --git a/web/src/pages/Doc/en/constructor/index.md b/web/src/pages/Doc/en/constructor/index.md
index 60621e58..bd0cead0 100644
--- a/web/src/pages/Doc/en/constructor/index.md
+++ b/web/src/pages/Doc/en/constructor/index.md
@@ -41,6 +41,9 @@ const mindMap = new MindMap({
| enableFreeDrag(v0.2.4+) | Boolean | false | Enable node free drag | |
| watermarkConfig(v0.2.4+) | Object | | Watermark config, Please refer to the table 【Watermark config】 below for detailed configuration | |
| textAutoWrapWidth(v0.3.4+) | Number | 500 | Each line of text in the node will wrap automatically when it reaches the width | |
+| customHandleMousewheel(v0.4.3+) | Function | null | User-defined mouse wheel event processing can pass a function, and the callback parameter is the event object | |
+| mousewheelAction(v0.4.3+) | String | zoom | The behavior of the mouse wheel, `zoom`(Zoom in and out)、`move`(Move up and down). If `customHandleMousewheel` passes a custom function, this property will not take effect | |
+| mousewheelMoveStep(v0.4.3+) | Number | 100 | When the `mousewheelAction` is set to `move`, you can use this attribute to control the step length of the view movement when the mouse scrolls. The unit is `px` | |
### Watermark config
diff --git a/web/src/pages/Doc/en/constructor/index.vue b/web/src/pages/Doc/en/constructor/index.vue
index 14df481d..2636449e 100644
--- a/web/src/pages/Doc/en/constructor/index.vue
+++ b/web/src/pages/Doc/en/constructor/index.vue
@@ -147,6 +147,27 @@
Each line of text in the node will wrap automatically when it reaches the width |
|
+
+| customHandleMousewheel(v0.4.3+) |
+Function |
+null |
+User-defined mouse wheel event processing can pass a function, and the callback parameter is the event object |
+ |
+
+
+| mousewheelAction(v0.4.3+) |
+String |
+zoom |
+The behavior of the mouse wheel, zoom(Zoom in and out)、move(Move up and down). If customHandleMousewheel passes a custom function, this property will not take effect |
+ |
+
+
+| mousewheelMoveStep(v0.4.3+) |
+Number |
+100 |
+When the mousewheelAction is set to move, you can use this attribute to control the step length of the view movement when the mouse scrolls. The unit is px |
+ |
+
Watermark config
diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md
index 5b85076a..0748ce2f 100644
--- a/web/src/pages/Doc/zh/changelog/index.md
+++ b/web/src/pages/Doc/zh/changelog/index.md
@@ -1,5 +1,11 @@
# Changelog
+## 0.4.3
+
+修复:前进回退后没有触发`data_change`事件的问题。
+
+新增:支持自定义鼠标滚轮事件;鼠标滚轮调整为支持缩放视图和上下移动视图。
+
## 0.4.2
新增:`Node`类的`setText`方法增加第二个参数,以支持设置富文本内容。
diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue
index 523eec29..20e4d540 100644
--- a/web/src/pages/Doc/zh/changelog/index.vue
+++ b/web/src/pages/Doc/zh/changelog/index.vue
@@ -1,6 +1,9 @@
Changelog
+
0.4.3
+
修复:前进回退后没有触发data_change事件的问题。
+
新增:支持自定义鼠标滚轮事件;鼠标滚轮调整为支持缩放视图和上下移动视图。
0.4.2
新增:Node类的setText方法增加第二个参数,以支持设置富文本内容。
0.4.1
diff --git a/web/src/pages/Doc/zh/constructor/index.md b/web/src/pages/Doc/zh/constructor/index.md
index a9c873c1..97aa5adf 100644
--- a/web/src/pages/Doc/zh/constructor/index.md
+++ b/web/src/pages/Doc/zh/constructor/index.md
@@ -41,6 +41,9 @@ const mindMap = new MindMap({
| enableFreeDrag(v0.2.4+) | Boolean | false | 是否开启节点自由拖拽 | |
| watermarkConfig(v0.2.4+) | Object | | 水印配置,详细配置请参考下方表格【水印配置】 | |
| textAutoWrapWidth(v0.3.4+) | Number | 500 | 节点内每行文本达到该宽度后自动换行 | |
+| customHandleMousewheel(v0.4.3+) | Function | null | 自定义鼠标滚轮事件处理,可以传一个函数,回调参数为事件对象 | |
+| mousewheelAction(v0.4.3+) | String | zoom | 鼠标滚轮的行为,`zoom`(放大缩小)、`move`(上下移动)。如果`customHandleMousewheel`传了自定义函数,这个属性不生效 | |
+| mousewheelMoveStep(v0.4.3+) | Number | 100 | 当`mousewheelAction`设为`move`时,可以通过该属性控制鼠标滚动一下视图移动的步长,单位`px` | |
### 水印配置
diff --git a/web/src/pages/Doc/zh/constructor/index.vue b/web/src/pages/Doc/zh/constructor/index.vue
index 7778b81f..7412c20e 100644
--- a/web/src/pages/Doc/zh/constructor/index.vue
+++ b/web/src/pages/Doc/zh/constructor/index.vue
@@ -147,6 +147,27 @@
节点内每行文本达到该宽度后自动换行 |
|
+
+| customHandleMousewheel(v0.4.3+) |
+Function |
+null |
+自定义鼠标滚轮事件处理,可以传一个函数,回调参数为事件对象 |
+ |
+
+
+| mousewheelAction(v0.4.3+) |
+String |
+zoom |
+鼠标滚轮的行为,zoom(放大缩小)、move(上下移动)。如果customHandleMousewheel传了自定义函数,这个属性不生效 |
+ |
+
+
+| mousewheelMoveStep(v0.4.3+) |
+Number |
+100 |
+当mousewheelAction设为move时,可以通过该属性控制鼠标滚动一下视图移动的步长,单位px |
+ |
+
水印配置
diff --git a/web/src/pages/Edit/components/BaseStyle.vue b/web/src/pages/Edit/components/BaseStyle.vue
index c6b49687..e8c07dcd 100644
--- a/web/src/pages/Edit/components/BaseStyle.vue
+++ b/web/src/pages/Edit/components/BaseStyle.vue
@@ -431,7 +431,26 @@
- {{ this.$t('baseStyle.isEnableNodeRichText') }}
+ {{ $t('baseStyle.isEnableNodeRichText') }}
+
+
+
+
+ {{ $t('baseStyle.mousewheelAction') }}
+ {
+ updateOtherConfig('mousewheelAction', value)
+ }
+ "
+ >
+
+
+
@@ -493,7 +512,8 @@ export default {
nodeUseLineStyle: false
},
config: {
- enableFreeDrag: false
+ enableFreeDrag: false,
+ mousewheelAction: 'zoom'
},
watermarkConfig: {
show: false,
@@ -541,6 +561,7 @@ export default {
},
created () {
this.enableNodeRichText = this.localConfig.openNodeRichText
+ this.mousewheelAction = this.localConfig.mousewheelAction
},
methods: {
...mapMutations(['setLocalConfig']),
@@ -579,7 +600,7 @@ export default {
// 初始化其他配置
initConfig() {
- ['enableFreeDrag'].forEach(key => {
+ ;['enableFreeDrag', 'mousewheelAction'].forEach(key => {
this.config[key] = this.mindMap.getConfig(key)
})
},
@@ -686,7 +707,15 @@ export default {
this.setLocalConfig({
openNodeRichText: e
})
- }
+ },
+
+ // 切换鼠标滚轮的行为
+ mousewheelActionChange(e) {
+ this.setLocalConfig({
+ mousewheelAction: e
+ })
+ this.mindMap.updateConfig
+ },
}
}