From 9b2c9ad1d2e70863e048ae1001958f65cc93edb3 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: Tue, 21 Jan 2025 16:14:45 +0800 Subject: [PATCH] =?UTF-8?q?Demo=EF=BC=9A=E5=B7=A5=E5=85=B7=E6=A0=8F?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=85=AC=E5=BC=8F=E6=8C=89=E9=92=AE=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=98=AF=E5=90=A6=E5=BC=80=E5=90=AF=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=AF=8C=E6=96=87=E6=9C=AC=E9=85=8D=E7=BD=AE=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=92=8C=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/Edit/components/Toolbar.vue | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/web/src/pages/Edit/components/Toolbar.vue b/web/src/pages/Edit/components/Toolbar.vue index 98c27b8a..68c028ce 100644 --- a/web/src/pages/Edit/components/Toolbar.vue +++ b/web/src/pages/Edit/components/Toolbar.vue @@ -215,7 +215,8 @@ export default { computed: { ...mapState({ isDark: state => state.localConfig.isDark, - isHandleLocalFile: state => state.isHandleLocalFile + isHandleLocalFile: state => state.isHandleLocalFile, + openNodeRichText: state => state.localConfig.openNodeRichText }) }, watch: { @@ -223,6 +224,24 @@ export default { if (!val) { Notification.closeAll() } + }, + openNodeRichText: { + immediate: true, + handler(val) { + const index = this.list.findIndex(item => { + return item === 'formula' + }) + if (val) { + if (index === -1) { + this.list.splice(13, 0, 'formula') + } + } else { + if (index !== -1) { + this.list.splice(index, 1) + } + } + this.computeToolbarShow() + } } }, created() { @@ -246,6 +265,7 @@ export default { methods: { // 计算工具按钮如何显示 computeToolbarShow() { + if (!this.$refs.toolbarRef) return const windowWidth = window.innerWidth - 40 const all = [...this.list] let index = 1