--- order: 2 title: zh-CN: 滚动容器 en-US: Container to scroll. --- ## zh-CN 用 `target` 设置 `Affix` 需要监听其滚动事件的元素,默认为 `window`。 ## en-US Set a `target` for 'Affix', which is listen to scroll event of target element (default is `window`). ```tsx import { Affix, Button } from 'antd'; import React, { useState } from 'react'; const App: React.FC = () => { const [container, setContainer] = useState(null); return (
container}>
); }; export default App; ```