-
-
Notifications
You must be signed in to change notification settings - Fork 859
[solved] v-t
directive needs custom directive to work with SSR
#293
Comments
Hi, @kazupon. |
according to the docs :
https://kazupon.github.io/vue-i18n/en/directive.html#t-vs-v-t |
Whoa!!!! How did I missed that?!! I've read that page like 20 times before...orz |
v-t
directive doesn't work with SSR, only $t('') works.v-t
directive needs custom directive to work with SSR
example usage with nuxt, see: nuxt/nuxt#1826 (comment) |
Found that the SSR custom directive only works with primitive html tags, but not with vue components such as |
vue & vue-i18n version
[email protected] (with [email protected])
[email protected]
Reproduction Link
Online Demo
Github Repo
Steps to reproduce
Open the online demo link:
{{ $t('xxx') }}
shows immediately (SSR) butv-t="'xxx'"
shows a bit later (no SSR)Only
{{ $t() }}
is server side rendered,v-t="'xxx"
isn't.What is Expected?
v-t
directive to work nicely with SSRWhat is actually happening?
contents using
v-t
don't show in SSR result, which makes:The text was updated successfully, but these errors were encountered: