完成单曲搜索,其他pr
This commit is contained in:
@@ -5,7 +5,7 @@ export default createStore({
|
||||
// appVersion: "0.0.1",
|
||||
// debugStr: "测试debug字符",
|
||||
showSongDetail: false, //是否显示歌曲详情
|
||||
keywords: '', //查询关键字
|
||||
keywords: "", //查询关键字
|
||||
settings: {
|
||||
currentRoute: "/discover/recommend", //当前路由
|
||||
songId: 0, //歌曲id
|
||||
@@ -125,6 +125,25 @@ export default createStore({
|
||||
saveLoaclSettings(state.settings);
|
||||
}
|
||||
},
|
||||
// 搜索历史
|
||||
addSearchHistory(state, history) {
|
||||
let h = state.settings.searchHistory.filter(
|
||||
(item) => item != history
|
||||
);
|
||||
h.unshift(history);
|
||||
state.settings.searchHistory = h;
|
||||
saveLoaclSettings(state.settings);
|
||||
},
|
||||
removeSearchHistory(state, history) {
|
||||
state.settings.searchHistory = state.settings.searchHistory.filter(
|
||||
(item) => item != history
|
||||
);
|
||||
saveLoaclSettings(state.settings);
|
||||
},
|
||||
clearSearchHistory(state) {
|
||||
state.settings.searchHistory = []
|
||||
saveLoaclSettings(state.settings);
|
||||
},
|
||||
},
|
||||
actions: {},
|
||||
modules: {},
|
||||
|
||||
Reference in New Issue
Block a user