1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-20 05:39:40 +02:00
mealie/frontend/components/global/AdvancedOnly.vue

22 lines
413 B
Vue
Raw Normal View History

<template>
<div scoped-slot />
</template>
<script lang="ts">
/**
* Renderless component that only renders if the user is logged in.
* and has advanced options toggled.
*/
export default defineNuxtComponent({
setup(_, ctx) {
const $auth = useMealieAuth();
const r = $auth.user.value?.advanced || false;
return () => {
return r ? ctx.slots.default?.() : null;
};
},
});
</script>