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.

Single file component: conditional templates malfunctionning after 2.1.0

See original GitHub issue

Hi,

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:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bartlomiejucommented, Nov 23, 2016

Can confirm, I have exactly same issue since update to 2.1.0 yesterday. It also happens with v-show

0reactions
yyx990803commented, Nov 23, 2016

Closing in favor of #4290 since both seem to be the same issue

Read more comments on GitHub >

github_iconTop 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 >

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