Skip to content

Commit

Permalink
增加默认选取tag
Browse files Browse the repository at this point in the history
  • Loading branch information
master1lan committed Jan 28, 2023
1 parent 49aaffc commit 8322e6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/routers/layout/nav/VideoTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,5 @@ const nav_tag_list_no_id: Omit<VideoNavQueryItemType, "id" | "cancelable">[] = [
id: nanoid(3),
cancelable: false,
})) as VideoNavQueryItemType[];

export const VideoQueryNavList = video_query_nav_list;
12 changes: 9 additions & 3 deletions src/store/tags/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { VideoNavQueryItemType } from "@routers/layout/nav/VideoTools";
import {
VideoNavQueryItemType,
VideoQueryNavList,
} from "@routers/layout/nav/VideoTools";
import {
PhotoNavQueryItemType,
PhotoQueryNavList,
Expand All @@ -10,7 +13,10 @@ const Photo_Topic_id_all = PhotoQueryNavList.find(
(item) => item.queryString === 0
)!,
Photo_type_default = PhotoQueryNavList.find(
(item) => item.queryString === "recommend"
(item) => item.queryString === "latest"
)!,
Video_default_show = VideoQueryNavList.find(
(item) => item.queryString === "pubdate"
)!;

interface TagStates {
Expand All @@ -24,7 +30,7 @@ interface TagStates {
PhotoActivetags: PhotoNavQueryItemType[];
}
const initialState: TagStates = {
VideoActiveTags: [],
VideoActiveTags: [Video_default_show],
PhotoActivetags: [Photo_Topic_id_all, Photo_type_default],
};
export const ActiveTagsSlice = createSlice({
Expand Down

0 comments on commit 8322e6a

Please sign in to comment.