npm.io
0.1.3 • Published 9 years ago

class100-integral

Licence
Version
0.1.3
Deps
6
Vulns
0
Weekly
0

class100-integral 大课组件 计分板

何时使用

开发基于dva的react组件时

npm install -S class100-integral 

API


import { Integral, Ranking, Scoreboard } from 'class100-integral';
Integral 计分板组件 API
参数 说明 类型 默认值
className 类名 string
teams team列表 array
showNum 排名每页显示个数 number 6
onAddTeam 添加team function({ team: {}, teams: [] })
onDeleteTeam 删除team function({ team: {}, teams: [] })
onAddPoints team加分 function({ team: {}, teams: [] })
onTeamChange team信息修改 function({ team: {}, teams: [] })
onShowTable 显示排名 function({ teams: [] })
onHideTable 隐藏排名 function({})
onRankingPrev 排名上一页 function({ page: 1, teams: [] })
onRankingNext 排名下一页 function({ page: 1, teams: [] })
Ranking 计分排位组件 API
参数 说明 类型 默认值
className 类名 string
teams 显示team例表数据 array
Scoreboard 添加分数组件 API
参数 说明 类型 默认值
className 类名 string
team 当前team数据 object
team json
{
 id: md5(new Date() + Math.random()),    // id
 ranking: 1,    // 排名
 name: 'team-1',    // 名称
 addPoints: 0,   // 添加分数
 points: 0,   // 总分
}

开发

  1. clone 代码
git clone https://github.com/hexiao-o/IntegralPlate.git
  1. 安装依赖和启动服务
1. 新开窗口 cd class100-integral && npm install && cd example && npm install
2. 新开窗口 npm run dev
  1. 打开网页
open http://localhost:3000