mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-19 03:57:28 +08:00
feat(ui): 重构 SearchBar、集成 useScrollTitle 标题滚动显示、修复专辑搜索跳转
- 重新设计 SearchBar:左侧 Tab(播放列表/MV/排行榜)+ 滑动指示器 + 搜索框自动展开收缩 - 新增 navTitle store 和 useScrollTitle hook,支持页面滚动后在 SearchBar 显示标题 - 集成 useScrollTitle 到 MusicListPage、歌手详情、关注/粉丝列表、搜索结果页 - 修复搜索结果页专辑点击跳转失败(缺失 type 字段) - 新增 5 种语言 searchBar tab i18n 键值
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { ref } from 'vue';
|
||||
|
||||
/**
|
||||
* 导航栏标题 store
|
||||
* 用于页面滚动后在 SearchBar 中显示当前页面标题
|
||||
* 无持久化,页面卸载时自动清除
|
||||
*/
|
||||
export const useNavTitleStore = defineStore('navTitle', () => {
|
||||
const title = ref('');
|
||||
const isVisible = ref(false);
|
||||
|
||||
const setTitle = (t: string) => {
|
||||
title.value = t;
|
||||
};
|
||||
|
||||
const setVisible = (v: boolean) => {
|
||||
isVisible.value = v;
|
||||
};
|
||||
|
||||
const clear = () => {
|
||||
title.value = '';
|
||||
isVisible.value = false;
|
||||
};
|
||||
|
||||
return { title, isVisible, setTitle, setVisible, clear };
|
||||
});
|
||||
Reference in New Issue
Block a user