mirror of https://github.com/halo-dev/halo
feat: store attachment view type to localStorage (#4477)
#### What type of PR is this? /kind improvement /kind console #### What this PR does / why we need it: 修改附件显示模式后,保存状态 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/4476 #### Does this PR introduce a user-facing change? ```release-note Console 端附件管理的显示模式支持缓存到浏览器。 ```pull/4456/head^2
parent
ab5c7da66b
commit
42ef7265c7
|
@ -42,6 +42,7 @@ import { useRouteQuery } from "@vueuse/router";
|
|||
import { useFetchAttachmentGroup } from "./composables/use-attachment-group";
|
||||
import { usePermission } from "@/utils/permission";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useLocalStorage } from "@vueuse/core";
|
||||
import UserFilterDropdown from "@/components/filter/UserFilterDropdown.vue";
|
||||
|
||||
const { currentUserHasPermission } = usePermission();
|
||||
|
@ -196,7 +197,7 @@ const viewTypes = [
|
|||
},
|
||||
];
|
||||
|
||||
const viewType = useRouteQuery<string>("view", "list");
|
||||
const viewType = useLocalStorage("attachment-view-type", "list");
|
||||
|
||||
// Route query action
|
||||
const routeQueryAction = useRouteQuery<string | undefined>("action");
|
||||
|
|
Loading…
Reference in New Issue