Files
mealie/frontend/components/global/ToggleState.vue

28 lines
431 B
Vue
Raw Normal View History

<template>
<component :is="tag">
<slot
name="activator"
2026-03-23 21:18:25 +01:00
v-bind="{ toggle, modelValue }"
/>
2026-03-23 21:18:25 +01:00
<slot v-bind="{ modelValue, toggle }" />
</component>
</template>
2026-03-23 21:18:25 +01:00
<script setup lang="ts">
const modelValue = defineModel({
type: Boolean,
default: false,
});
2026-03-23 21:18:25 +01:00
defineProps({
tag: {
type: String,
default: "div",
},
});
2026-03-23 21:18:25 +01:00
const toggle = () => {
modelValue.value = !modelValue.value;
};
</script>