Call for Examples
This section is pretty empty right now. It could need some more lovely examples.
PRs are welcome 😃
This is the starter example from the "Getting Started" page, demonstrating the basic usage.
<template> <Design-Container> <Design-Panel color="green" text="Source"> <p> The content below this paragraph is rendered in the right/bottom (red) container by PortalVue </p> <Portal to="right-basic"> <p class="red"> This is content from the left/top container (green). The cool part is, it works across components, so you can send your content anywhere! </p> </Portal> </Design-Panel> <Design-Panel color="red" text="Target" left> <PortalTarget name="right-basic"></PortalTarget> </Design-Panel> </Design-Container> </template>
Dynamic sidebar content
By selectively rendering different
<Portal> components that all send to the same
<PortalTarget> (but not at the same time), we can replace the
<PortalTarget>'s content on demand, e.g. to put something into a sidebar area from teh main component:
The example is still missing, haven't gotten around to migrating it from this codepen of v1
More to follow
More examples will hopefully follow soon. Send me some suggestions!