@opensig/opendesign
Version:
109 lines (108 loc) • 3.12 kB
TypeScript
import { ExtractPropTypes, PropType } from 'vue';
import { DirectionT } from '../_utils/types';
export type AnchorDirectionT = DirectionT;
export declare const AnchorSizeTypes: readonly ["medium", "small", "menu"];
export type AnchorSizeT = (typeof AnchorSizeTypes)[number];
export type AnchorTargetT = '_blank' | '_parent' | '_self' | '_top';
export declare const anchorProps: {
/**
* @zh-CN 锚点的方向,支持水平(h)与垂直(v)
* @en-US The orientation of the anchor, supports both horizontal(h) and vertical(v).
* @default 'v'
* @since 1.2.0 新增水平模式(h)
*/
layout: {
type: PropType<AnchorDirectionT>;
default: string;
};
/**
* @zh-CN 锚点的尺寸,仅垂直模式支持, menu为左侧菜单或移动端菜单混合使用
* @en-US Anchor size, 'menu' for aside menu-mixed or mobile menu mode
* @default 'medium'
*/
size: {
type: PropType<AnchorSizeT>;
default: string;
};
/**
* @zh-CN 监测容器
* @en-US Scroll container to monitor
* @default window
*/
container: {
type: PropType<string | HTMLElement | Window>;
};
/**
* @zh-CN 锚点激活的边界范围
* @en-US Boundary for anchor activation
* @default 5
*/
bounds: {
type: NumberConstructor;
default: number;
};
/**
* @zh-CN 锚点激活的判定边界
* @en-US Boundary for anchor activation
* @default 0
*/
targetOffset: {
type: NumberConstructor;
default: number;
};
/**
* @zh-CN 点击锚点时是否改变浏览器地址栏的 hash 值
* @en-US Whether to change the browser's address bar hash value when clicking the anchor
* @default true
*/
changeHash: {
type: BooleanConstructor;
default: boolean;
};
};
export declare const anchorItemProps: {
/**
* @zh-CN 锚点标题
* @en-US Anchor title
*/
title: {
type: StringConstructor;
default: string;
};
/**
* @zh-CN 锚点监听、跳转的目标元素(带#前缀)
* @en-US Target element for anchor navigation (with # prefix)
*/
href: {
type: StringConstructor;
required: boolean;
};
/**
* @zh-CN 锚点监听的目标元素(带#前缀),不传时监听href
* @en-US Target element for anchor observe (with # prefix),Use href prop by default
*/
observeHref: {
type: StringConstructor;
};
/**
* @zh-CN 锚点跳转方式
* @en-US Anchor navigation method
* @default '_self'
*/
target: {
type: PropType<AnchorTargetT>;
default: string;
};
/**
* @zh-CN 锚点是否禁用
* @en-US Anchor disable status
* @default false
*/
disabled: {
type: PropType<boolean>;
default: boolean;
};
};
export type AnchorContainerT = HTMLElement | Window;
export type AnchorPropsT = ExtractPropTypes<typeof anchorProps>;
export type AnchorItemPropsT = ExtractPropTypes<typeof anchorItemProps>;