how can i set a document.title according to a condition in mounted? (vue.js)
I wanted the title to be set as soon as the page loaded, but instead nothing happens and just the same title ‘localhost’ remains.
Adding attribute to HTML elements to whole code
I’m using Nuxt 2 in my project with Storyblok datasources as translations and e.g. I’ve:
<span v-text="$t('labels.cartSell')" />
and I need to add something like data-translation="labels.cartSell"
to that span
. The problem is I’ve more than 600 $t
uses in my code. Is there any possibility to add attribute automatically to every element in my code which contain $t
?
Adding attribute to HTML elements to whole code
I’m using Nuxt 2 in my project with Storyblok datasources as translations and e.g. I’ve:
<span v-text="$t('labels.cartSell')" />
and I need to add something like data-translation="labels.cartSell"
to that span
. The problem is I’ve more than 600 $t
uses in my code. Is there any possibility to add attribute automatically to every element in my code which contain $t
?