feat: switch to spa
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
// Lets a routed page hand AppHeader a title built from data only that page
|
||||
// has fetched (e.g. "Noita Submissions — Semifinal", assembled from an API
|
||||
// call keyed by the scopeId route param). Cleared on every navigation so a
|
||||
// stale title never lingers while the next page is still loading.
|
||||
export const usePageHeaderStore = defineStore("pageHeader", () => {
|
||||
const title = ref("");
|
||||
|
||||
const setTitle = (value: string) => {
|
||||
title.value = value;
|
||||
};
|
||||
|
||||
const clear = () => {
|
||||
title.value = "";
|
||||
};
|
||||
|
||||
return { title, setTitle, clear };
|
||||
});
|
||||
Reference in New Issue
Block a user