--- order: 5 title: zh-CN: 设置锚点滚动偏移量 en-US: Set Anchor scroll offset --- ## zh-CN 锚点目标滚动到屏幕正中间。 ## en-US Anchor target scroll to screen center. ```tsx import { Anchor } from 'antd'; import React, { useEffect, useState } from 'react'; const { Link } = Anchor; const App: React.FC = () => { const [targetOffset, setTargetOffset] = useState(undefined); useEffect(() => { setTargetOffset(window.innerHeight / 2); }, []); return ( ); }; export default App; ```