From 182cdf5153c87c5d82a776c35002eb23269918b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Mon, 12 Aug 2024 10:58:17 +0800 Subject: [PATCH] =?UTF-8?q?Feat=EF=BC=9A=E4=B8=8D=E9=98=BB=E6=AD=A2mousedo?= =?UTF-8?q?wn=E3=80=81mousemove=E4=BA=8B=E4=BB=B6=E7=9A=84=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/event/Event.js | 2 -- web/src/pages/Edit/components/FormulaSidebar.vue | 1 + web/src/pages/Edit/components/Navigator.vue | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/simple-mind-map/src/core/event/Event.js b/simple-mind-map/src/core/event/Event.js index b81d95e6..0a5f2ad5 100644 --- a/simple-mind-map/src/core/event/Event.js +++ b/simple-mind-map/src/core/event/Event.js @@ -99,7 +99,6 @@ class Event extends EventEmitter { // 鼠标按下事件 onMousedown(e) { - e.preventDefault() // 鼠标左键 if (e.which === 1) { this.isLeftMousedown = true @@ -115,7 +114,6 @@ class Event extends EventEmitter { // 鼠标移动事件 onMousemove(e) { - e.preventDefault() let { useLeftKeySelectionRightKeyDrag } = this.mindMap.opt this.mousemovePos.x = e.clientX this.mousemovePos.y = e.clientY diff --git a/web/src/pages/Edit/components/FormulaSidebar.vue b/web/src/pages/Edit/components/FormulaSidebar.vue index 6ee47d2e..bf8217b5 100644 --- a/web/src/pages/Edit/components/FormulaSidebar.vue +++ b/web/src/pages/Edit/components/FormulaSidebar.vue @@ -80,6 +80,7 @@ export default { ...mapMutations(['setActiveSidebar']), init() { + if (!window.katex) return this.list = formulaList.map(item => { return { overview: window.katex.renderToString( diff --git a/web/src/pages/Edit/components/Navigator.vue b/web/src/pages/Edit/components/Navigator.vue index 530bcfea..fe5424a6 100644 --- a/web/src/pages/Edit/components/Navigator.vue +++ b/web/src/pages/Edit/components/Navigator.vue @@ -169,7 +169,7 @@ export default { if (!this.withTransition) { this.withTransition = true } - this.mindMap.miniMap.onMouseup(e) + if (this.mindMap.miniMap) this.mindMap.miniMap.onMouseup(e) }, // 视口框的鼠标按下事件