fix(title): trully reactive tool title

This commit is contained in:
Corentin Thomasset 2022-06-02 00:58:31 +02:00
parent f48cd058cf
commit c2e1d59cb9
No known key found for this signature in database
GPG key ID: DBD997E935996158

View file

@ -3,13 +3,13 @@ import { useRoute } from 'vue-router';
import BaseLayout from './base.layout.vue';
import { useHead } from '@vueuse/head';
import type { HeadObject } from '@vueuse/head';
import { reactive } from 'vue';
import { computed } from 'vue';
import { useThemeVars } from 'naive-ui';
const route = useRoute();
const theme = useThemeVars();
const head = reactive<HeadObject>({
const head = computed<HeadObject>(() => ({
title: `${route.meta.name} - IT Tools`,
meta: [
{
@ -21,7 +21,7 @@ const head = reactive<HeadObject>({
content: route.meta.keywords,
},
],
});
}));
useHead(head);
</script>