v-bind
without default ending space
#8771
Closed
kaikaibenkai
started this conversation in
General Discussions
Replies: 1 comment 1 reply
-
No, that not Vue mistake, that actually how HTML work. Multiple space is count as single space, including the breakline. In vanilla HTML, this code: <span>
Hello
<sup>1</sup>
</span> is equal to this: <span>
Hello <sup>1</sup>
</span> So, if you don't wanna add the space, you need to write like this: <template>
<span v-for='item in list' :key='item'>
{{ item }}<sup>{{ item - 1 }}</sup>
</span>
</template>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I wrote down this, I was surprised to find that the binding value would end with a space by default.
I checked the compiled rendering function:
Why is there a space here?Or how to remove this space?Beta Was this translation helpful? Give feedback.
All reactions