Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138249

Vue & conditional rendering with template tag

$
0
0

I am trying to follow documentation:

But for some reason my template is not working as expected, as soon as I put <template v-if="variable"> vue fails to render anything.

<script type="text/x-template" id="dashboard-inititial-message">

<template v-if="okBoom">
    <h1>Title</h1>
    <p>Paragraph 1</p>
    <p>Paragraph 2</p>
</template>

<div v-if="ok">
    <h1>Title</h1>
    <p>Paragraph 1</p>
    <p>Paragraph 2</p>
</div>
<div v-else>
    <p>ELSE</p>
</div>
</script>

Any advice?

Snippets that demonstrate problem:

https://jsfiddle.net/o2tL2ems/1/


Viewing all articles
Browse latest Browse all 138249

Trending Articles