简体   繁体   中英

How to I add space in data-bind"text:..."?

I'm trying to add space between file names in a div. It looks like this

<span class="upload-bar__file-name" data-bind="text: name"></span>

I tried this but didn't work

<span class="upload-bar__file-name" data-bind="text: ' ' + name"></span>

EDIT: I'm trying to accomplish this :

if there are 3 names: AB and C , I want it to be displayed like this : ABC and not like this : ABC

You can use

<span class="upload-bar__file-name" data-bind="text: '&nbsp;' + name"></span>

to add a so-called "non-breaking space" to the name

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM