Portal
Portal allows content to escape width restrictions of a Block or HeroBlock.
Portal will render content at the end of the root div. This lets you to build something like a sidebar menu.
CAVEATS:
-
You should only use this component in the
HeroBlock, and only once. -
It only allows a single child inside it:
// THIS WILL BREAK <Portal> <div> <!-- content --> </div> <div> <!-- content --> </div> </Portal> // Correct <Portal> <div> <!-- content --> </div> </Portal> -
Because of the restrictions of Vue 2, the content will be sent to another block and will not inherit the styles from the element with same
kindin theBlock. -
This component uses
portal-vueinternally so it will have same caveats. However, in normal use, you should only need to take special care of theref problem
| Props | Type | Mandatory? | Description |
| open | boolean | ✅ | Use to control it open or close |
| slots | Description |
| Default | The content |
Example:
<template>
<HeroBlock :block="block">
<Portal>
<!-- content will be render at the end of root div element -->
</Portal>
</HeroBlock>
</template>