This commit is contained in:
2024-10-22 09:09:41 +08:00
parent ef869c5ab1
commit 3a9b2d55c6
99 changed files with 4506 additions and 3465 deletions

View File

@@ -2,9 +2,12 @@ import { inject, computed, isRef, provide, reactive } from "vue";
const LevelInjectionKey = Symbol("menuLevelKey");
function provideLevel(level) {
const computedLevel = computed(() => isRef(level) ? level.value : level);
provide(LevelInjectionKey, reactive({
level: computedLevel
}));
provide(
LevelInjectionKey,
reactive({
level: computedLevel
})
);
}
function useLevel(props) {
const { provideNextLevel } = props || {};