File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,16 @@ const extension_data = reactive({
5050 data: [],
5151 message: " " ,
5252});
53- const showReserved = ref (false );
53+
54+ // 从 localStorage 恢复显示系统插件的状态,默认为 false(隐藏)
55+ const getInitialShowReserved = () => {
56+ if (typeof window !== " undefined" && window .localStorage ) {
57+ const saved = localStorage .getItem (" showReservedPlugins" );
58+ return saved === " true" ;
59+ }
60+ return false ;
61+ };
62+ const showReserved = ref (getInitialShowReserved ());
5463const snack_message = ref (" " );
5564const snack_show = ref (false );
5665const snack_success = ref (" success" );
@@ -290,6 +299,10 @@ const updatableExtensions = computed(() => {
290299// 方法
291300const toggleShowReserved = () => {
292301 showReserved .value = ! showReserved .value ;
302+ // 保存到 localStorage
303+ if (typeof window !== " undefined" && window .localStorage ) {
304+ localStorage .setItem (" showReservedPlugins" , showReserved .value .toString ());
305+ }
293306};
294307
295308const toast = (message , success ) => {
You can’t perform that action at this time.
0 commit comments