add browser infos in html dataset
This commit is contained in:
parent
1ed7aa9c5b
commit
83f6a93d28
3 changed files with 19 additions and 3 deletions
14
src/App.vue
14
src/App.vue
|
|
@ -7,9 +7,17 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { storeToRefs } from "pinia";
|
||||
import Menu from "./components/Menu.vue";
|
||||
import { usePageStore } from "./stores/page";
|
||||
import { storeToRefs } from 'pinia';
|
||||
import Menu from './components/Menu.vue';
|
||||
import { usePageStore } from './stores/page';
|
||||
import { detect } from 'detect-browser';
|
||||
|
||||
const browser = detect();
|
||||
|
||||
if (browser) {
|
||||
document.querySelector(
|
||||
'html'
|
||||
).dataset.browser = `${browser.name} ${browser.version} ${browser.os}`;
|
||||
}
|
||||
const { page } = storeToRefs(usePageStore());
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue