2023-03-08 15:32:24 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
function useLegacyUseHead () {
|
|
|
|
useHead({
|
|
|
|
titleTemplate: '%s - VueUse head polyfill test'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
function useLegacyVueUseHead () {
|
|
|
|
// get vm
|
|
|
|
const vm = getCurrentInstance()
|
|
|
|
const head = vm?.appContext.provides.usehead
|
|
|
|
head.addHeadObjs({
|
|
|
|
title: 'using provides usehead and updateDOM'
|
|
|
|
})
|
|
|
|
head.updateDOM()
|
|
|
|
}
|
|
|
|
|
|
|
|
useLegacyUseHead()
|
|
|
|
useLegacyVueUseHead()
|
|
|
|
</script>
|
2023-11-09 17:01:13 +00:00
|
|
|
|
2023-03-08 15:32:24 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<h1>VueUse head polyfill test</h1>
|
2024-01-28 21:25:42 +00:00
|
|
|
<!-- This component is only here to make it a shared chunk for test in `styles.vue` -->
|
|
|
|
<SharedComponent />
|
2023-03-08 15:32:24 +00:00
|
|
|
</div>
|
|
|
|
</template>
|