From fea7d32c9787489c98c2fcd3402d81973126dcc1 Mon Sep 17 00:00:00 2001 From: wanglin25 Date: Mon, 14 Nov 2022 19:25:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A6=85=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/api/index.js | 25 +++++++++ web/src/lang/en_us.js | 3 +- web/src/lang/zh_cn.js | 3 +- web/src/pages/Edit/Index.vue | 29 ++++++++-- web/src/pages/Edit/components/Contextmenu.vue | 16 ++++++ web/src/pages/Edit/components/Count.vue | 18 +++++-- web/src/pages/Edit/components/Edit.vue | 12 +++-- web/src/pages/Edit/components/Style.vue | 18 +++++-- web/src/pages/Edit/components/Toolbar.vue | 54 +++++++++++++++---- web/src/store.js | 21 +++++++- 10 files changed, 172 insertions(+), 27 deletions(-) diff --git a/web/src/api/index.js b/web/src/api/index.js index db1ad0a7..b36ffddd 100644 --- a/web/src/api/index.js +++ b/web/src/api/index.js @@ -4,6 +4,7 @@ import Vue from 'vue' const SIMPLE_MIND_MAP_DATA = 'SIMPLE_MIND_MAP_DATA' const SIMPLE_MIND_MAP_LANG = 'SIMPLE_MIND_MAP_LANG' +const SIMPLE_MIND_MAP_LOCAL_CONFIG = 'SIMPLE_MIND_MAP_LOCAL_CONFIG' /** * @Author: 王林 @@ -101,3 +102,27 @@ export const getLang = () => { storeLang('zh') return 'zh' } + +/** + * javascript comment + * @Author: 王林25 + * @Date: 2022-11-14 18:57:31 + * @Desc: 存储本地配置 + */ +export const storeLocalConfig = config => { + localStorage.setItem(SIMPLE_MIND_MAP_LOCAL_CONFIG, JSON.stringify(config)) +} + +/** + * javascript comment + * @Author: 王林25 + * @Date: 2022-11-14 18:57:37 + * @Desc: 获取本地配置 + */ +export const getLocalConfig = () => { + let config = localStorage.getItem(SIMPLE_MIND_MAP_LOCAL_CONFIG) + if (config) { + return JSON.parse(config) + } + return null +} diff --git a/web/src/lang/en_us.js b/web/src/lang/en_us.js index 835e8493..748b4c52 100644 --- a/web/src/lang/en_us.js +++ b/web/src/lang/en_us.js @@ -43,7 +43,8 @@ export default { level3: 'Level3', level4: 'Level4', level5: 'Level5', - level6: 'Level6' + level6: 'Level6', + zenMode: 'Zen mode' }, count: { words: 'Words', diff --git a/web/src/lang/zh_cn.js b/web/src/lang/zh_cn.js index 213df682..3253f74e 100644 --- a/web/src/lang/zh_cn.js +++ b/web/src/lang/zh_cn.js @@ -43,7 +43,8 @@ export default { level3: '三级主题', level4: '四级主题', level5: '五级主题', - level6: '六级主题' + level6: '六级主题', + zenMode: '禅模式' }, count: { words: '字数', diff --git a/web/src/pages/Edit/Index.vue b/web/src/pages/Edit/Index.vue index 3691b8d3..96091a77 100644 --- a/web/src/pages/Edit/Index.vue +++ b/web/src/pages/Edit/Index.vue @@ -1,7 +1,7 @@