UNPKG

elegant-wui-uni

Version:

一个基于Vue3+TS开发的uni-app组件库,提供70+高质量组件,支持暗黑模式、国际化和自定义主题。

29 lines (23 loc) 684 B
import type { InjectionKey } from 'vue' import type { ExtractPropTypes } from 'vue' import { makeBooleanProp } from '../common/props' export type AnchorIndex = number | string export const indexBarProps = { /** * @description 索引是否吸顶 */ sticky: makeBooleanProp(false) } export interface KeyListRectInfo { top: number height: number index: string } export type IndexBarProps = ExtractPropTypes<typeof indexBarProps> export type InderBarProvide = { props: { sticky?: boolean } anchorState: { activeIndex: AnchorIndex | null // 当前激活的索引 } } export const indexBarInjectionKey: InjectionKey<InderBarProvide> = Symbol('wui-index-bar')