I'm trying to make my own version of the https://vuetifyjs.com/en/components/expansion-panels.
How can I get it so the emit inside of ExpansionPanel
can then call a function inside of ExpansionPanels
without having to change anything inside of App.vue
?
It currently looks something like:
<!-- ExpansionPanels.vue -->
<template>
<div>
<slot @open:panel="openPanel" />
</div>
</template>
<script setup>
const openPanel = () => {
...
}
</script>
<!-- ExpansionPanel.vue -->
<div>
<slot />
...
<button @click="$emit('open:panel')" />
</div>
<!-- App.vue -->
<expansion-panels>
<expansion-panel v-for="...">
...
</expansion-panel>
</expansion-panels>