Skip to content

Template compile error when defining a default slot without a single root element. #828

Closed
@andre-tebart

Description

@andre-tebart

Version

1.0.0-beta.20

Reproduction link

https://codesandbox.io/s/wox3y9zljl

Steps to reproduce

  1. Look at the src/TestComponent.spec.js
  2. Look at the Vue warn message in the Console tab
[Vue warn]: Error compiling template:


<div>Hello</div><div>World</div>


- 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.
  1. Look at the test tab and see that the 'mount with default slot' test fails.

What is expected?

That the test passes. The defined default slot contains a template string with two div elements next to each other and no single root element. In regular Vue templates there is no problem defining a default slot without a single root element when the slot content gets embedded inside another element.

What is actually happening?

The test fails and produces the mentioned template compile error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions