#898·vue-i18n

Render html tags with component interpolation

Author: leandromatos-hotmartCreated May 27, 2020Updated Jul 18, 2024
LabelsType: Feature

It's possible to render html tags with component interpolation?

Example:

javascript
const messages = {
  en: {
    text: '<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit.</p><p>Lorem ipsum, dolor {email}.</p>',
    email: '[email protected]'
  }
}
xml
<i18n path="text" tag="div">
  <my-link place="email" :href="`mailto:$t('email')`">{{ $t('args.email') }}</my-link>
</i18n>

I expect two paragraphs, and in the second paragraph, one link with my custom link component, but, the paragraphs was rendering as strings and not as html tags.

Maybe it's is a bug? Or is impossible to render an html tags inside a component?