vue-meta icon indicating copy to clipboard operation
vue-meta copied to clipboard

How to dynamically update "title" and other meta tags?

Open yakhyomus opened this issue 1 year ago • 3 comments

Vuejs 3 ("vue-meta": "^3.0.0-alpha.8")

On my vue page i'm trying update title like that: data() { title: 'title' }, setup () { useMeta({ title: this.title }); }, created() { this.title = 'New title' }

ang get: Cannot read properties of undefined (reading 'title')

How i can fix that? Thank you!

yakhyomus avatar Jan 29 '24 05:01 yakhyomus

@yakhyomus any luck?

habib-it avatar Apr 29 '24 13:04 habib-it

@yakhyomus any luck?

In vuejs you can't dynamically update meta tags, now i'm using vuejs 2

yakhyomus avatar Apr 29 '24 21:04 yakhyomus

@yakhyomus yes brother i tried a way but it also didn't work but i found a solution with new package that is for vue 3 https://www.npmjs.com/package/@unhead/vue https://github.com/unjs/unhead

to dynamic set meta tags we can work like this.

habib-it avatar Apr 30 '24 10:04 habib-it