mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-08 22:15:34 -04:00
chore: script setup components (#7299)
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
<template>
|
||||
<div scoped-slot />
|
||||
<slot v-if="advanced" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
<script setup 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 auth = useMealieAuth();
|
||||
|
||||
const r = auth.user.value?.advanced || false;
|
||||
|
||||
return () => {
|
||||
return r ? ctx.slots.default?.() : null;
|
||||
};
|
||||
},
|
||||
});
|
||||
const advanced = auth.user.value?.advanced || false;
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user