all
This commit is contained in:
@@ -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 || {};
|
||||
|
||||
Reference in New Issue
Block a user