Options API Dynamic Title
eberkund opened this issue · comments
Erik Berkun-Drevnig commented
I am using Vue 3 with the options API and while static titles work fine, I cannot seem to get dynamic ones to work:
<script lang="ts">
export default {
data() {
return {
foo: "hello world",
};
},
head() {
return {
title: this.foo,
};
},
};
</script>
<template>
<div>
<h1>Hello World</h1>
</div>
</template>
I also tried using this.$data.foo
in head()
with no success.
Harlan Wilton commented
Thanks for reporting. Should be fixed in 1.0.19
antsteyeragorize commented
Hi @harlan-zw , I tried same code in Vue 2.7.14 and version 1.1.26 of @vueuse/head, but it doesn't seem to work. Is it limited to Vue 3+ ?
Harlan Wilton commented
Will track here #187