Notes
Sidepanel activation
To control sidepanel visibility you can use v-model
or v-trigger
component.
Example - props
<template>
<v-button @click="isOpen = !isOpen">Toggle sidepanel</v-button>
<v-sidepanel
v-model="isOpen"
v-bind="example"
>
<template #header>
<span class="text-xl font-bold">Sidepanel</span>
</template>
<div class="p-5">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the
1500s, when an unknown printer took a galley of type and scrambled it to
make a type specimen book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining essentially
unchanged. It was popularised in the 1960s with the release of Letraset
sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem
Ipsum.
</div>
</v-sidepanel>
</template>
<script setup>
import { ref, reactive } from "vue";
let example = reactive({
showCloseButton: true,
sidebarLeft: false,
width: "320px",
modal: false,
noHeader: false,
transition: "fade-slide",
});
let isOpen = ref(false);
</script>
Example - open by id
You can also control state of the sidepanel menu by using v-trigger
component. The for
prop of the v-trigger
should be the same as id
of the sidepanel. The advantage of this method is that v-triggers
can be put anywhere in application. Read more about v-trigger here.
<template>
<v-trigger for="sidepanel" v-slot="{ onTrigger }">
<v-button v-on="onTrigger">Toggle sidepanel</v-button>
</v-trigger>
<v-sidepanel id="sidepanel">
<template #header>
<span class="text-xl font-bold">Sidepanel</span>
</template>
<div class="p-5">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the
1500s, when an unknown printer took a galley of type and scrambled it to
make a type specimen book. It has survived not only five centuries, but
also the leap into electronic typesetting, remaining essentially
unchanged. It was popularised in the 1960s with the release of Letraset
sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem
Ipsum.
</div>
</v-sidepanel>
</template>