feat: 添加 UI 状态管理,支持新增记录底部弹窗功能,优化设置和主页交互

This commit is contained in:
2025-12-02 16:22:46 +08:00
parent a81b106ac8
commit 629a54c92d
12 changed files with 265 additions and 47 deletions

View File

@@ -1,10 +1,12 @@
<script setup>
import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useUiStore } from '../stores/ui'
// 使用路由信息来高亮当前 Tab而不是从父组件传递状态
const route = useRoute()
const router = useRouter()
const uiStore = useUiStore()
const currentTab = computed(() => route.name)
@@ -14,7 +16,7 @@ const goTab = (name) => {
}
const openAdd = () => {
router.push({ name: 'add' })
uiStore.openAddEntry()
}
</script>