UNPKG

baked-recipe-admin

Version:

Baked is an opinionated framework for .NET in backend and Nuxt in frontend. This is a recipe package that brings together all the components one needs for an Admin UI.

71 lines (57 loc) 1.41 kB
import { inject, provide, ref } from "vue"; export default function() { function add(name) { const path = inject("__bake_path", null); provide("__bake_path", path ? `${path}/${name}` : name); } function path() { return inject("__bake_path", ""); } function dataDescriptor() { return inject("__bake_data_descriptor", null); } function setDataDescriptor(value) { return provide("__bake_data_descriptor", value); } function injectedData() { return { ParentData: inject("__bake_injected_data:ParentData", null), Custom: inject("__bake_injected_data:Custom", null) }; } function setInjectedData(value, key) { provide(`__bake_injected_data:${key}`, value); } function loading() { return inject("__bake_loading", ref(false)); } function setLoading(value) { provide("__bake_loading", value); } function page() { return inject("__bake_page"); } function setPage(value) { provide("__bake_page", value); } function articleOverflow() { return inject("__bake_article_overflow", ref(false)); } function setArticleOverflow(value) { provide("__bake_article_overflow", value); } return { add, path, dataDescriptor, setDataDescriptor, injectedData, setInjectedData, loading, setLoading, page, setPage, articleOverflow, setArticleOverflow }; }