You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Syntax highlight for script tag content in .vue files disappeared when adding a template tag with v-slot:namedSlot
Reproducible Case
Create a single file component that has named slots. Import the component inside another component, reference it in template tags and insert template tags with v-slot:slotName attribute and the content of script tag looses its syntax highlight. See images.
The text was updated successfully, but these errors were encountered:
@luxwarp I just met the same problem as yours. Thanks for reminding me to check the template tag.
I had a template tag in the template, but without v-slot direct. Like what you do, comment it, and things go well.
So I guess it may be caused by the format of the template tag. After trying some format adjustment, I found it.
before(bad situation):
<template>some code</template>
after(good situation):
<template>some code</template>
Yeah, it's exactly the </template>‘s > in a new line cause the problem.
If someone makes one of his </template>'s > in a new line, including the .vue file’s outer template tag, congratulation, he reproduces the case.
That's the problem.
Very interesting! After som pokeing around in my codes i finally got it working by just change my code to this and make sure that eslint/prettier did not try to format the code, and it does not :).
So its both a "bug" for prettier in vue projects and maybe vetur also to not be able to handle prettiers wierd formatting :D
<NoListItemsFound v-else>
<template v-slot:title>
No to-do's found
</template>
<template v-slot:subtitle>
Create one now!
</template>
</NoListItemsFound>
I just heard from one of my colleagues, prettier makes such formatting to get rid of the spaces on the two side of the content when vue complies the template. He thinks it's a 'bug' of vue. Funny 😃
So prittier may act reasonable here.
Duplicate of #1211. I'm afraid there's no easy fix in TextMate grammar and you would have to wait for the upcoming semantic syntax highlighting in VS Code.
Info
Problem
Syntax highlight for script tag content in .vue files disappeared when adding a template tag with v-slot:namedSlot
Reproducible Case
Create a single file component that has named slots. Import the component inside another component, reference it in template tags and insert template tags with v-slot:slotName attribute and the content of script tag looses its syntax highlight. See images.
The text was updated successfully, but these errors were encountered: