🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@lydxwj/react-fullpage

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lydxwj/react-fullpage

全屏翻页组件

latest
Source
npmnpm
Version
0.0.5
Version published
Weekly downloads
4
-42.86%
Maintainers
1
Weekly downloads
 
Created
Source

@lydxwj/react-fullpage

安装

npm install @lydxwj/react-fullpage --save

使用

import { PageContainer, Pages } from '@lydxwj/react-fullpage';
import '@lydxwj/react-fullpage/lib/css/styles.css';

<PageContainer onChange={(nowIdx, newIdx) => {
  console.log(nowIdx);
  console.log(newIdx);
}} onChangeEnd={(nowIdx) => {
  console.log(nowIdx);
}}>
  <Pages style={{
    backgroundColor: '#51eabe',
  }}></Pages>
  <Pages style={{
    backgroundColor: '#f4ea2a',
  }}></Pages>
  <Pages style={{
    backgroundColor: '#1afa29',
  }}></Pages>
  <Pages style={{
    backgroundColor: '#1296db',
  }}></Pages>
</PageContainer>

组件介绍

import { PageContainer, Pages } from '@lydxwj/react-fullpage';
// PageContainer翻页组件盒子,Pages单个翻页组件

// 或者 import PageContainer from '@lydxwj/react-fullpage';
// PageContainer翻页组件盒子,PageContainer.Pages单个翻页组件

组件配置

  • PageContainer
配置项介绍参数/默认值
onChange页面翻转前回调nowIdx(当前页索引), newIdx(翻转页页索引)
onChangeEnd页面翻转后回调nowIdx(当前页索引)
isArrow是否显示下滑提示箭头true(默认值)
isNav是否显示指示器true(默认值)
style样式对象建议不设置height、width
// PageContainer里面嵌套Pages来使用
<PageContainer>
  <Pages></Pages>
</PageContainer>
  • Pages
配置项介绍参数/默认值
againCof回看配置{ isShow: true,是否显示 text: '回看', 文案配置}
again回看回调
style样式对象建议不设置height、width
// Pages可以嵌套自己想要的页面内容
<Pages>
  <div>页面内容</div>
</Pages>

说明: 仅支持移动端

如果有问题欢迎交流

Keywords

react

FAQs

Package last updated on 21 Dec 2018

Did you know?

Socket

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.

Install

Related posts