How to update head meta attribute after serverPrefetch? (Qv2 SSR) #8963
Unanswered
SuspiciousLookingOwl
asked this question in
CLI - SSR mode
Replies: 2 comments 1 reply
-
If you depend on some internal state of the component, then use the "Reactive" approach (supply a function instead of an Object). createMetaMixin(function () {
return {
title: `${this.player.name} Hello World`,
}
}) |
Beta Was this translation helpful? Give feedback.
1 reply
-
Any answer?? I am also having the same issue. Is there no functional way to update meta data outside of setup function if its not going to be reactive in SSR? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using vue-class-component and vuex-module-decorators. This is how my code looks like
The code above works fine, the data is fetched on server side, the
<title>
is set toHello World
and my component is prerendered on server side with the vuex store data.However I wanted to change the rendered
<title>
dynamically to something likeBut this doesn't seems to be working as
mixins
can't accessthis
, when I doconsole.log(this)
insideget mixins() {...}
, I getMixedVue {}
on the SSR console (I assume it's because mixins runs first before components)?.I already tried to use composition reactive meta but it doesn't work either (updating the composition state doesn't update the title inside
useMeta
, I assume it's because the data isn't reactive in server side?).P.S. I already added
plugins: ["Meta"],
toquasar.conf.js
Beta Was this translation helpful? Give feedback.
All reactions