Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: uncleared history #354

Merged
merged 2 commits into from
Aug 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/stores/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
Loading