petkopalko
petkopalko

Reputation: 600

Non breaking spaces are rendered as regular space in vue template

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?

Upvotes: 7

Views: 5373

Answers (1)

Daniel Fu
Daniel Fu

Reputation: 156

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

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

Upvotes: 14

Related Questions