Anchor Props# 成员说明类型默认值版本 affix 固定模式 boolean true bounds 锚点区域边界 number 5 getContainer 指定滚动的容器 () => HTMLElement () => window getCurrentAnchor 自定义高亮的锚点 (activeLink: string) => string - offsetTop 距离窗口顶部达到指定偏移量后触发 number showInkInFixed ...
问题二:点击右侧锚点左侧页面能正常滚动跳转,滑动左侧页面,右侧锚点没联动,原因大致有两种情况1、未配置:getContainer="getContainer"属性,2、配置完上面的属性还是没效果,大概率是锚点锚定的id未设置好自动滚动属性,需要注意关联的是父级还是平级的div; 经过反复的研究测试-Anchor锚点组件能够正常使用,核心代码如下: //...
getContainerScrolling container() => HTMLElement() => window getCurrentAnchorCustomize the anchor highlight(activeLink: string) => string- offsetTopPixels to offset from top when calculating position of scrollnumber0 showInkInFixedWhether show ink-square whenaffix={false}booleanfalse ...
getContainer 指定滚动的容器 () => HTMLElement () => window getCurrentAnchor 自定义高亮的锚点 (activeLink: string) => string - activeLink(3.3) offsetBottom 距离窗口底部达到指定偏移量后触发 number offsetTop 距离窗口顶部达到指定偏移量后触发 number showInkInFixed :affix="false" 时是否显示小方...
ant design中锚点Anchor在二级页面中设置滚动偏移量 版本: react: 18.2.0 antd:5.1.1 AnchorPage,tsx import React, { useEffect, useState } from 'react'; import { Anchor, Row, Col } from 'antd'; const AnchorPage = () => { const topRef = React.useRef<HTMLDivElement>(null);...
getContainerScrolling container() => HTMLElement() => window getCurrentAnchorCustomize the anchor highlight(activeLink: string) => string-activeLink(3.3) offsetBottomPixels to offset from bottom when calculating position of scrollnumber- offsetTopPixels to offset from top when calculating position of ...
getContainer指定 Modal 挂载的 HTML 节点(instance): HTMLElement() => document.body keyboard是否支持键盘 esc 关闭booleantrue mask是否展示遮罩Booleantrue maskClosable点击蒙层是否允许关闭booleantrue maskStyle遮罩样式object{} okText确认按钮文字string|slot确定 ...
Anchor示例加getContainer={() => document.querySelector('#aaaa')} What is expected? 在编辑器编译通过,在codepen能正常显示 What is actually happening? 1、在codepen运行此代码,鼠标滚动页面时,锚点导航没有变化; 2、在vscode运行此代码,编译报错: ...
duration自动关闭的延时,单位秒。设为 0 时不自动关闭。number3 onClose关闭时触发的回调函数Function- icon自定义图标VNode- key当前提示的唯一标志string|number- 全局方法 还提供了全局配置和全局销毁方法: message.config(options) message.destroy() message.config ...
当页面滚动不在body时,给Anchor设置getContainer 返回报错 What is expected? 返回正常 What is actually happening? [Vue warn]: Error in nextTick: "TypeError: Cannot read property 'addEventListener' of undefined" found in ---> TypeError: Cannot read property 'addEventListener' of undefined Uncaught Ty...