Skip to main content
Version: v3

SlideInApi

API for displaying Slide-In panels in Rancher UI

  • slidein Example

Methods​

open()​

open(component, config?): void;

Opens a slide in panel in Rancher UI

Example:

import { useShell } from '@shell/apis';
import MyDrawer from '@/components/MyDrawer.vue';

const shell = useShell();

shell.slideIn.open(MyDrawer, {
width: 'wide',
props: { resource }
});

Make RcDrawer from @components/RcDrawer the root of the component, and leave title out so it is not wrapped in a second drawer. The panel closes when the component emits close:

const emit = defineEmits<{ close: [] }>();

emit('close');

Closing on close is new in Rancher 2.16. Before that nothing listens for it, so an extension that also runs on older versions passes a handler with the props: props: { resource, onClose: () => store.commit('slideInPanel/close') }.

Parameters​

component​

Component

The Vue component to be displayed inside the slide in panel. This can be any SFC (Single-File Component) imported and passed in as a Component.

config?​

SlideInConfig

Slide-In configuration object

Returns​

void