A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vuejs/vue-next/issues/3766 below:

'preserve' causes compiler error with named slots and default slot · Issue #3766 · vuejs/core · GitHub

Version

3.1.0-beta.3

Reproduction link

https://codesandbox.io/s/tender-night-xbivj?file=/src/components/HelloWorld.vue

Steps to reproduce

(Note: Minimal reproduction is missing turning on compilerOptions: { whitespace: 'preserve' }. I've spent too much time trying to get it to be set in codesandbox.io. Any help appreciated)

  1. Turn on compilerOptions: { whitespace: 'preserve' }.
  2. Use a component that takes a named slot and a default slot formatted with a line break between the template tags.
    <slotted-component>
      <template #header> Test Header </template>
      <template #default> Test Default </template>
    </slotted-component>
What is expected?

Component to compile correctly.

What is actually happening?

VueCompilerError: Extraneous children found when component already has explicitly named default slot. These children will be ignored.

If you remove the line break between the template tags, the compiler is happy.

natuan62 and PatrickStarer


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4