
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
@uiw/react-affix
Advanced tools
使用图钉,可以将内容固定在屏幕可视范围,并且不随页面的滚动而滚动,常用于菜单等。
import { Affix } from 'uiw';
// or
import Affix from '@uiw/react-affix';
import React from 'react';
import { Affix, Button } from 'uiw';
export default function Demo() {
return (
<Affix offsetTop={60}>
<Button type="primary">1 当按钮距离顶部距离为 0,按钮被钉在顶部</Button>
</Affix>
)
}
这个实例需要你缩小窗口高度,就可以测试看效果啦。
import React from 'react';
import { Affix, Button } from 'uiw';
export default function Demo() {
return (
<Affix offsetBottom={10} onChange={(affixed) => {
console.log('affixed::', affixed);
}}>
<Button type="primary" style={{ marginLeft: 20 }}>2 当按钮距离底部距离为 0,按钮被钉在底部</Button>
</Affix>
)
}
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
offsetBottom | 距离窗口底部达到指定偏移量后触发 | Number | - |
offsetTop | 距离窗口顶部达到指定偏移量后触发 | Number | - |
onChange | 固定状态改变时触发的回调函数 | Function(affixed) | - |
FAQs
Affix component
The npm package @uiw/react-affix receives a total of 128 weekly downloads. As such, @uiw/react-affix popularity was classified as not popular.
We found that @uiw/react-affix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.