mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-06 04:55:35 -04:00
28 lines
431 B
Vue
28 lines
431 B
Vue
<template>
|
|
<component :is="tag">
|
|
<slot
|
|
name="activator"
|
|
v-bind="{ toggle, modelValue }"
|
|
/>
|
|
<slot v-bind="{ modelValue, toggle }" />
|
|
</component>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const modelValue = defineModel({
|
|
type: Boolean,
|
|
default: false,
|
|
});
|
|
|
|
defineProps({
|
|
tag: {
|
|
type: String,
|
|
default: "div",
|
|
},
|
|
});
|
|
|
|
const toggle = () => {
|
|
modelValue.value = !modelValue.value;
|
|
};
|
|
</script>
|