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
Hilary Liu 2023-08-24 22:38:14 +08:00 committed by GitHub
parent ab5c7da66b
commit 42ef7265c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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");