Single file component: conditional templates malfunctionning after 2.1.0
See original GitHub issueHi,
Not sure which Vue subproject this issue refers to, but conditional templates started to malfunction in single file component since 2.1.0.
Simple reproduction:
<template>
<div>
<template v-if="true === true">
<section class="section">
<div class="container">
Should be shown
</div>
</section>
</template>
<template v-else>
<p>Shoud not be shown</p>
</template>
</div>
</template>
Should not be shown
is shown, whereas Should be shown
should be.
Note if you remove the outer div class container
and leave only the inner text, Should be shown
is indeed shown.
This only happen with single file component (e.g. this jsfiddle works).
EDIT: Fix wrong jsfiddle link
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:7 (4 by maintainers)
Top Results From Across the Web
vue.js - v-if not working for single File template - Stack Overflow
So I have the following Vue app. App.vue <template id="main-page"> <v-ons-page> <l-map ref="map" v-if="showMap" :zoom="zoom" ...
Read more >vue-template-compiler | Yarn - Package Manager
This package can be used to pre-compile Vue 2.0 templates into render functions to avoid runtime-compilation overhead and CSP restrictions.
Read more >Prettier 2.1: new --embedded-language-formatting option and ...
When Prettier identifies cases where it looks like you've placed some code it knows how to format within a string in another file,...
Read more >Use ASP.NET Core APIs in a class library - Microsoft Learn
Learn how to use ASP.NET Core APIs in a class library.
Read more >Documentation: Cascading Style Sheets - HUBzero Help
CSS can also be placed inside a HTML file between <style ... be addressed in the template's primary stylesheet after loading reset.css ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can confirm, I have exactly same issue since update to 2.1.0 yesterday. It also happens with
v-show
Closing in favor of #4290 since both seem to be the same issue