1.0.3 • Published 4 years ago

jun-react v1.0.3

Weekly downloads
8
License
ISC
Repository
github
Last release
4 years ago

React 组件库

Installation

Install with npm:

npm install --save-dev jun-react

Install with yarn:

yarn add jun-react --dev

Usage

ES6 module:

import { Countdown } from 'jun-react';

// 60秒倒计时
ReactDOM.render(
  <Countdown count={60} suffix="s" />,
  mountNode
);

Script:

<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <title>jun-react</title>
  <link rel="stylesheet" type="text/css" href="jun-react.css">
</head>
<body>
  <div id="root"></div>
  <script type="text/javascript" charset="utf-8" src="react.js"></script>
  <script type="text/javascript" charset="utf-8" src="react-dom.js"></script>
  <script type="text/javascript" charset="utf-8" src="browser.js"></script>
  <script type="text/javascript" charset="utf-8" src="jun-react.js"></script>
  <script type="text/babel">
    const Countdown = junReact.Countdown;
    // 60秒倒计时
    ReactDOM.render(
      <Countdown count={60} suffix="s" />,
      document.getElementById('root')
    );
  </script>
</body>
</html>

Note

部分组件需要引入样式

Components

Pagination

缺省总条数的分页

样式:jun-react/lib/components/pagination/style.css

PropertyDescriptionTypeDefault
dataSize当前返回数据条数number
current当前页码number
onChange页码改变的回调function
pageSize每页条数number10
showQuickJumper是否可以快速跳转至某页booleanfalse
showSizeChanger是否可以改变pageSizebooleanfalse
pageSizeOptions指定每页可以显示多少条string[]'10','20','30','40'

Countdown

倒计时

PropertyDescriptionTypeDefaultOptional
count计数number
type类型stringnormalnormal常规,hour小时
prefix文案前缀string
suffix文案后缀string
onComplete倒计时结束回调function

ImgCatch

图片异常捕获

PropertyDescriptionTypeDefault
src图片资源string
blanksrc空白页图片资源string
onError图片加载失败回调function

ImgView

移动端图片全屏预览

样式:jun-react/lib/components/imgView/style.css

PropertyDescriptionTypeDefault
src图片资源string
1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago