0

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>
seyet
  • 1,080
  • 4
  • 23
  • 42

1 Answers1

0

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

<div v-html="description.home"></div>
Y. S.
  • 1
  • 1