OrionAside
<o-aside> creates an <aside> tag in the DOM that appear from the right of the window in a simple animation. It can be opened using refs or with the prop display.
Good to know
OrionAside and OrionModal work in a very similar way.
Popables
OrionNotif, OrionAside and OrionModal are parts of the Popables family.
It means that you can open a new aside without closing the actual. If you do so, the first one will be kept in queue and reappear when you close the second one.
This behaviour can be customized to fit your needs.
More informations on this mecanism on the Popables documentation.
Example in the nested component documentation part.
Usage
Asides can be used in multiples ways
- in the template, using
refsor the propdisplayto hide or show an aside. - programmatically with
useAside(customOptions).
AsideStyle AsideSlots AsideNested
<template>
<o-section :title="`${title} ${uid ?? ''}`">
<p>
Etiam porta sem malesuada magna mollis euismod.
Etiam porta sem malesuada magna mollis euismod.
Aenean lacinia bibendum nulla sed consectetur.
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Cras justo odio, dapibus ac facilisis in, egestas eget quam.
</p>
<p>
Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
Eget lacinia odio sem nec elit.
Cras justo odio, dapibus ac facilisis in, egestas eget quam.
Vestibulum id ligula porta felis euismod semper.
Nulla vitae elit libero, a pharetra augue.
</p>
</o-section>
<o-section align="right">
<o-button
v-if="uid"
color="warning"
outline
@click="_aside?.close({ flush: true })">
Close and flush queue
</o-button>
<o-button
color="danger"
outline
@click="_aside?.close()">
Close aside
</o-button>
<o-button
color="info"
@click="openNew()">
Open a new aside
</o-button>
</o-section>
</template>
<script setup lang="ts">
import { inject } from 'vue';
import { useAside, getUid } from 'lib';
import NestedComp from './NestedComp.vue';
defineProps<{ title: string, uid?: number }>();
const _aside = inject<OrionAside>('_aside');
function openNew () {
useAside({
Nested: NestedComp,
NestedProps: {
title: `Queued aside`,
uid: getUid(),
},
});
}
</script>
AsidePlayground
Props
Name
display
boolean = undefinedoptions
Partial<Orion.Popable.Options> & Partial<Orion.Aside.Options> = () => ({}) as Partial<Orion.Popable.Options>Events
Name
Payload type
enter-start
enter-end
leave-start
leave-end
Slots
Name
Bindings
poster
No bindingsheader
No bindingsactions
close:
() => voidfooter
close:
functiondefault
close:
() => voidPublicInstance
Name
Type
slotPoster
stringslotFooter
stringslotActions
stringslotHeader
string_loader
() => OrionLoaderuid
numberbus
Busstate
{
isClosing: boolean;
isOpening: boolean;
isMounted: boolean;
visible: boolean;
}options
Orion.Popable.Optionsopen
(keepInQueue?: boolean) => Promise<void>close
(options?: Orion.Popable.CloseOptions) => Promise<void>trigger
(eventName: string, params?: any) => voidanimateAsync
(enter: boolean) => Promise<void>removeProgrammatic
() => voidisLastOpenedPopable
() => boolean_el
() => HTMLElement | undefinedProvide
Name
Type
_aside
publicInstance