question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vue `v-else-if` wrong formatting

See original GitHub issue

If in blade template there is this tag

<span v-else-if="value.name === 'Name'">

formatting turns it into

<span v-else-if="value.name === 'Name'" v-else-if="value.name === 'Name'">

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
apasovcommented, Dec 26, 2022

Thanks!

Also I noticed it keeps adding this string on every iteration. So after several formattings I get this:

<span v-else-if="value.name === 'Name1'" v-else-if="value.name === 'Name1'" v-else-if="value.name === 'Name1'"
                                        v-else-if="value.name === 'Name1'">
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ugly formatting html in .vue file · Issue #5844 · prettier ... - GitHub
I just updated prettier in my vue project and now in a SFC .vue file it's formatting this code: Lista into this:
Read more >
Conditional Rendering - Vue.js
v-if is “real” conditional rendering because it ensures that event listeners and child components inside the conditional block are properly destroyed and re- ......
Read more >
Vue conditional rendering: editing existing todos
Result: editCancelled() method is invoked, which sets this.isEditing back to false , so that the edit form is no longer shown on re-render....
Read more >
How to get vue's v-else-if functionality in angular?
</div> <ng-template #elseBlock>Content to render when condition is false.</ng-template>. You can refer to the documentation.
Read more >
Conditional Directives With Vue.js - DigitalOcean
Now, the button will not show because isLoggedIn is set to false . Setting the data.isLoggedIn value to true would add the button...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found