
反射对讲机
演示 编号 : 文档 编号 :
其他构成部分
Conveyer在您的原生相册中加入了 Drag 手势 .
📱💻🖥
* 特性
- 您可以通过 Drag 使用类似 原生 Scroll 的行为 .
- 通过增加回放,弹性等放松功能,可以创建出"原生"等平滑滚动动画.
- 支持反应属性,通过自动检测变化而不是事件的属性可以改变状态.
- 您可以使用自定义卷轴事件, 如BeginScroll、FinishScroll、ReachStart、LeaveStart,
* 安装
$ npm install @egjs/react-conveyer
QQ 快速启动
使用交汇器方法的结果
import { useConveyer } from "@egjs/react-conveyer";
function App() {
const ref = useRef<HTMLDivElement>(null);
const {
// reactive properties
isReachStart,
isReachEnd,
// methods
scrollIntoView,
// events
onBeginScroll,
onFinishScroll,
} = useConveyer(ref, {
horizontal: false,
});
onBeginScroll(() => {
console.log("begin scroll");
}, []);
onFinishScroll(() => {
console.log("finish scroll");
}, []);
return (
<div className="App">
<button id="prev" disabled={isReachStart} onClick={() => {
// start to end
scrollIntoView("start", {
align: "end",
duration: 500,
});
}}>PREV</button>
<button id="next" disabled={isReachEnd} onClick={() => {
// end to start
scrollIntoView("end", {
align: "start",
duration: 500,
});
}}>NEXT</button>
<div className="items" ref={ref}>
<div className="item"><a href="#1">1</a></div>
<div className="item"><a href="#2">2</a></div>
<div className="item"><a href="#3">3</a></div>
<div className="item"><a href="#4">4</a></div>
<div className="item"><a href="#5">5</a></div>
<div className="item"><a href="#6">6</a></div>
<div className="item"><a href="#7">7</a></div>
<div className="item"><a href="#8">8</a></div>
<div className="item"><a href="#9">9</a></div>
<div className="item"><a href="#10">10</a></div>
<div className="item"><a href="#11">11</a></div>
<div className="item"><a href="#12">12</a></div>
</div>
</div>
);
}
QQ 支持的浏览器
| 9+( 带有多填充), 11+ 对角 & Svelte | 最新 | 最新 | 最新 | 7个+ | 4+ (中文(简体) ) |
德摩斯语
检查我们 演示文稿。 。 。 .
页:1
见 文档 页 次.
捐款
见 捐款额。 。 。 .
* 反馈
请存档 问题。 。 。 .
许可证
@egjs/ react-conveyer 发布在下面 麻省理工学院许可证。 。 。 .
Copyright (c) 2022-present NAVER Corp.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
