Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

(Document that) template rendering omits non-first tags #84

Closed
robinp opened this issue Apr 3, 2017 · 3 comments
Closed

(Document that) template rendering omits non-first tags #84

robinp opened this issue Apr 3, 2017 · 3 comments

Comments

@robinp
Copy link

robinp commented Apr 3, 2017

Expected behavior

Not sure if this is a main Vue doc issue, or only rollup-plugin-vue's. But it seems templates need a single root elem, and other elems are lost. Would be nice if the plugin could at least emit a warning about this.

Steps to reproduce the behavior

.vue file with:

<template>
  <h1>x</h1>
  <h2>y</h2>
</template>

rollup:

vue({compileTemplates:true})
@tedmeftah
Copy link

Yes it's Vue related

Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

I can't seem to find the exact passage on the Vue 2.0 docs page though there is a mention of it here.

@znck
Copy link
Member

znck commented May 3, 2017

I think throwing a warning at compile time would work here.

@znck
Copy link
Member

znck commented May 2, 2018

@vue/component-compiler-utils provides tips on issues with template. These tips and errors are logged out.

Should be resolved with v4+.

@znck znck closed this as completed May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants