
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
taro-lazy-swiper
Advanced tools
使用taro, 基于微信小程序 swiper 开发的 lazy swiper
loop 模式该模式下, 测试用例增加到了200条, 具体看 Scheduler.test.ts
loop 模式该模式下, 测试用例还没来得及新增
npm i taro-lazy-swiper
import LazySwiper, {useLazySwiper} from 'taro-lazy-swiper'
import {View} from "@tarojs/components";
const dataSource = Array(10).fill(0).map((_, i) => {
return {data: i + 1}
})
const App = () => {
const [lazySwiper] = useLazySwiper()
return (
<View>
<LazySwiper
lazySwiper={lazySwiper}
dataSource={dataSource}
keyExtractor={(data) => data.toString()}
renderContent={(data, { isActive }) => {
return `current: ${data}`
}}
/>
<View className='fixed-bar'>
<Button onClick={() => lazySwiper.prevSection()}>上一个</Button>
<Button onClick={() => lazySwiper.nextSection()}>下一个</Button>
<Button onClick={() => lazySwiper.toSection(0)}>回到头</Button>
</View>
</View>
)
}
| 属性 | 类型 | 描述 |
|---|---|---|
| dataSource | T[] | 数据源 |
| keyExtractor | (data: T, index: number) => string | key 计算 |
| renderContent | (data: T, info: { isActive: boolean, key: string } ) => React.ReactNode | 每个swiper item 的计算 |
| maxCount | number | 同时渲染的swiper item最大数量 |
| loop | boolean | 是否循环 |
| duration | number | 切换动画时长 |
| lazySwiper | LazySwiperExtra | 对外暴露的连接属性 |
| onBeforeChange | (detail: BeforeChangeEventDetail & { playload: any }) => boolean | 变更前,可以进行拦截(手势滑动的无法拦截) |
| onChange | (detail: ChangeEventDetail) => void | 当 index 变更后 |
| onAnimationFinish | (detail: ChangeEventDetail) => void | index 变更之后的动画结束后 |
| swiperItemExtractor | (data: T, index: number) => SwiperItemProps | swiper props 计算 |
拉取自己 fork 的项目
# ssh 方式
git clone git@github.com:[your github user name]/taro-lazy-swiper.git
cd taro-lazy-swiper
npm i
npm run dev:rollup
# taro-lazy-swiper
npm link
# 自己项目
npm link taro-lazy-swiper
kentcdodds/use-deep-compare-effect
等等...
FAQs
基于小程序 swiper 开发的 lazy swiper
The npm package taro-lazy-swiper receives a total of 14 weekly downloads. As such, taro-lazy-swiper popularity was classified as not popular.
We found that taro-lazy-swiper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.