From 832360419cd96dc5979094b7c20ce8758fd86e2f Mon Sep 17 00:00:00 2001 From: YangFong Date: Sun, 25 Aug 2024 16:29:44 +0800 Subject: [PATCH] fix: uncleared history (#354) --- src/stores/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/stores/index.js b/src/stores/index.js index e78586255..264616051 100644 --- a/src/stores/index.js +++ b/src/stores/index.js @@ -139,16 +139,20 @@ export const useStore = defineStore(`store`, () => { // 自定义 CSS 内容 const cssContent = useStorage(`__css_content`, DEFAULT_CSS_CONTENT) const cssContentConfig = useStorage(addPrefix(`css_content_config`), { - active: `方案 1`, + active: `方案1`, tabs: [ { - title: `方案 1`, - name: `方案 1`, + title: `方案1`, + name: `方案1`, // 兼容之前的方案 content: cssContent.value || DEFAULT_CSS_CONTENT, }, ], }) + onMounted(() => { + // 清空过往历史记录 + cssContent.value = `` + }) const getCurrentTab = () => cssContentConfig.value.tabs.find((tab) => { return tab.name === cssContentConfig.value.active })