Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

166
Visualizações
break line in locale text used in components vue

I am using locales for texts in my vue app and these texts need to have break lines in the in certain places. I have tried \n\ and <br> tags but they don't work. How can I go about breaking locale i18n text lines and use them in my components?

For example, the following text should go to a new line after "home is" and "heart is or"

locales/en.json:

"description": {
   "home": "home is \n where the heart is or <br> another random cliche sentence here"
}

components/hello.vue:

<div> {{$t("description.home")}}</div>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can use the v-html directive to show it:

<div v-html="description.home"></div>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda