Vue: html tag issue

Created on 8 Mar 2017  ·  3Comments  ·  Source: vuejs/vue

Vue.js version

2.0.2

Reproduction Link



https://jsfiddle.net/baturYe/x4m8w2xv/2/~~
https://jsfiddle.net/baturYe/x4m8w2xv/5/

Steps to reproduce

What is Expected?

template displays correctly

What is actually happening?

I am playing #5097 and found that when put \> in the template string, the result is not expected.

need repro

Most helpful comment

  • you can't add content to the same named slot multiple times.
  • your child component doesn't output the slot content anywhere
  • the child template has invalid html in line 15

Please explain in more detail what you actually expect, because it's not clear to me. It seems you think that you can concatenate slot contents. You can't, that's not a functionality Vue provides.

I will label this as "needs repo" because the reproduction provided does not work.

All 3 comments

  • you can't add content to the same named slot multiple times.
  • your child component doesn't output the slot content anywhere
  • the child template has invalid html in line 15

Please explain in more detail what you actually expect, because it's not clear to me. It seems you think that you can concatenate slot contents. You can't, that's not a functionality Vue provides.

I will label this as "needs repo" because the reproduction provided does not work.

Sorry, I paste the wrong link, I know it's invalid to use like that. Should vue complain about it when it is coded like this?

Well, that's because the backslash is an escape character in Javascript strings. using \\ leads to the expected result.

Was this page helpful?
0 / 5 - 0 ratings