Location>code7788 >text

Web-side ant-design-vue-Anchor Anchor component use vignette (1)

Popularity:765 ℃/2024-10-19 17:06:05
// Anchor jump method implementation
const handleClick: AnchorProps['onClick'] = (e, link) => {
();
(link, 'link');
(getContainer, 'getContainer');
if () {
// Find the node that corresponds to the anchor
let element = (('#', ''))

('element', element)
// If the anchor with the corresponding id exists, scroll to the top of the anchor
if (element) {
({
behavior: 'smooth'
});
}
}
};