portal-vue icon indicating copy to clipboard operation
portal-vue copied to clipboard

target multiple not working when slim

Open btoo opened this issue 6 years ago • 1 comments
trafficstars

If you use both multiple and slim on your <portal-target>, only the first <portal> to send content to the <portal-target> gets to have its content rendered. Here's a reproduction link: https://codesandbox.io/embed/portal-vue-multiple-slim-rdhet

btoo avatar Oct 09 '19 15:10 btoo

Yeah well that's expected.

mutliple = you have multiple root notes (at least one from each source) slim = use source content as portal-target's root node (Vue components need one root node) instead of a wrapper div.

So when you define slim, only the first of all the elements coming in will be displayed.

Also happens when you send slot content from a single source, but with multiple elements.

Docs can likely be improved here.

LinusBorg avatar Oct 09 '19 15:10 LinusBorg