Non breaking spaces are rendered as regular space in vue template

Viewed 2988

When I used   in Vue template, in browser they are rendered as regular space.

<template>
  <p>
     sample text in&nbsp;sample text 
     <strong>lorem ipsum</strong>
   </p>
</template>

Final render in browser looks like:

sample text in sample text lorem ipsum

My question is how to write non breaking spaces in template?

1 Answers
<p>
 sample text in{{'\xa0'}}sample text 
 <strong>lorem ipsum</strong>
<p>

Try to use the JavaScript escape code and not the HTML entity.

Related