generated from Seekra/repository-template
Compare commits
2
Commits
main
...
cba96d3b91
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cba96d3b91
|
||
|
|
255bbc0b7e
|
+5
-1
@@ -18,8 +18,12 @@ limitations under the License.
|
||||
import Navbar from './features/nav/components/Navbar.vue';
|
||||
import Footer from './features/footer/components/Footer.vue';
|
||||
|
||||
import { updatePageTitle } from './router';
|
||||
import { useColorScheme } from './features/colorScheme/composables/useColorScheme';
|
||||
import { ref, provide, watch } from 'vue';
|
||||
import { ref, provide, watch, watchEffect } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const { getColorScheme, updateColorScheme } = useColorScheme();
|
||||
const colorScheme = ref(getColorScheme());
|
||||
|
||||
+5
-6
@@ -59,18 +59,17 @@ const router = createRouter({
|
||||
routes
|
||||
});
|
||||
|
||||
// set page title
|
||||
router.afterEach(to => {
|
||||
export const updatePageTitle = function updatePageTitle (route) {
|
||||
const title =
|
||||
typeof to.meta.title === 'function'
|
||||
? to.meta.title(to)
|
||||
: to.meta.title;
|
||||
typeof route.meta.title === 'function'
|
||||
? route.meta.title(route)
|
||||
: route.meta.title;
|
||||
|
||||
if (title) {
|
||||
document.title = `${title} - Seekra`;
|
||||
} else {
|
||||
document.title = 'Seekra';
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user