mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-10 06:55:35 -04:00
chore: Nuxt 4 upgrade (#7426)
This commit is contained in:
27
frontend/app/components/global/ToggleState.vue
Normal file
27
frontend/app/components/global/ToggleState.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user