@varlet/ui
Version:
A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.
20 lines (19 loc) • 589 B
JavaScript
import { assert } from "@varlet/shared";
import { useParent } from "@varlet/use";
import {
BOTTOM_NAVIGATION_BIND_BOTTOM_NAVIGATION_ITEM_KEY
} from "../bottom-navigation/provide.mjs";
function useBottomNavigation() {
const { parentProvider, index, bindParent } = useParent(
BOTTOM_NAVIGATION_BIND_BOTTOM_NAVIGATION_ITEM_KEY
);
assert(!!bindParent, "BottomNavigationItem", "<var-bottom-navigation-item/> must in <var-bottom-navigation/>");
return {
index,
bottomNavigation: parentProvider,
bindBottomNavigation: bindParent
};
}
export {
useBottomNavigation
};