mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-19 13:19:41 +02:00
feat: add on mounted hook for bookmarklets (#1120)
* add utility type to hide Advanced items * add default text * fix #1115 and minor refactorings * generate types * hotfix: add validator to catch null vlaues
This commit is contained in:
parent
cfaac2e060
commit
3e3b43c977
5 changed files with 96 additions and 30 deletions
23
frontend/components/global/AdvancedOnly.vue
Normal file
23
frontend/components/global/AdvancedOnly.vue
Normal file
|
@ -0,0 +1,23 @@
|
|||
<template>
|
||||
<div scoped-slot></div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, useContext } from "@nuxtjs/composition-api";
|
||||
|
||||
/**
|
||||
* Renderless component that only renders if the user is logged in.
|
||||
* and has advanced options toggled.
|
||||
*/
|
||||
export default defineComponent({
|
||||
setup(_, ctx) {
|
||||
const { $auth } = useContext();
|
||||
|
||||
const r = $auth?.user?.advanced || false;
|
||||
|
||||
return () => {
|
||||
return r ? ctx.slots.default?.() : null;
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue