├── .gitignore
├── .babelrc
├── .eslintignore
├── src
├── component
│ ├── use
│ │ ├── listLoading
│ │ ├── useRollNotice.de
│ │ ├── useTabSwitch.de
│ │ ├── useMarquee.de
│ │ ├── useSpin.de
│ │ ├── useVerify.de
│ │ └── useDialog.de
│ ├── ListLoading
│ │ ├── index.js
│ │ └── listloading.less
│ ├── RollNotice
│ │ ├── demo.js
│ │ ├── notice.less
│ │ └── index.js
│ ├── TabSwitch
│ │ ├── demo.js
│ │ ├── tabswitch.less
│ │ └── index.js
│ ├── Marquee
│ │ ├── demo.js
│ │ ├── marquee.less
│ │ └── index.js
│ ├── Spin
│ │ ├── index.js
│ │ ├── demo.js
│ │ └── spin.less
│ ├── nav.js
│ ├── Verify
│ │ ├── demo.js
│ │ ├── verify.less
│ │ └── index.js
│ ├── Dialog
│ │ ├── showMsg.js
│ │ ├── index.js
│ │ ├── demo.js
│ │ ├── modal.less
│ │ └── modal.js
│ ├── data.js
│ ├── hello.js
│ ├── app.js
│ └── app.less
├── main.js
└── index.tpl.html
├── docs
├── vendor-49974.min.js
├── index.html
└── bundle-49974.min.css
├── README.md
├── .eslintrc
├── server.js
├── webpack.config.js
├── package.json
├── webpack.production.config.js
└── index.html
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | build/
3 | npm-debug.log
4 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["es2015", "stage-0", "react"]
3 | }
4 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 | dependent
4 | coverage
5 | webpack.*.js
6 | *Server.js
7 |
--------------------------------------------------------------------------------
/src/component/use/listLoading:
--------------------------------------------------------------------------------
1 | import ListLoading from ListLoading
2 |
3 | ...
4 | //无参数,直接调用即可
5 | ...
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom'
3 | import App from './component/app.js'
4 |
5 | ReactDOM.render(, document.getElementById('root'));
6 |
--------------------------------------------------------------------------------
/docs/vendor-49974.min.js:
--------------------------------------------------------------------------------
1 | !function(r){function e(t){if(o[t])return o[t].exports;var n=o[t]={exports:{},id:t,loaded:!1};return r[t].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var o={};e.m=r,e.c=o,e.p="./"}([]);
--------------------------------------------------------------------------------
/src/component/use/useRollNotice.de:
--------------------------------------------------------------------------------
1 | import RollNotice from 'RollNotice'
2 |
3 | ...
4 | const data = [
5 | '手机尾号1234的用户获得三等奖',
6 | '手机尾号7788的用户获得三等奖',
7 | '手机尾号3428的用户获得四等奖'
8 | ]
9 | return (
10 |
14 | )
15 | ...
16 |
17 |
--------------------------------------------------------------------------------
/src/component/ListLoading/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import style from './listloading.less';
3 |
4 | const ListLoading = () => (
5 |
6 |
加载中...
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | )
16 |
17 | export default ListLoading
18 |
19 |
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ActiUI
2 | 基于 React 的前端组件库,提供一些常用组件库里不常见的组件与功能,具体使用详情请查看 [https://tumars.github.io/ActiUI/](https://tumars.github.io/ActiUI/)
3 |
4 | ## 补充说明
5 | 这份组件库是刚学习 react 时写的,代码质量稀烂。。。。
6 |
7 | 由于 up 主业务缠身,太忙(懒),这份代码已经一年多未更新,年久失修,文件结构、代码规范、实现方式、语法逻辑等等都已比较落后。各位看看理念就好。up 主日后会抽时重新整理更新。
8 |
9 | 这份 https://github.com/tumars/boilerplate-webpack-react-es6-cssModule 使用了类似的理念与框架,代码相对较新。各位看官请参考这份。
10 |
11 | 谢谢。
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/component/RollNotice/demo.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import RollNotice from '../RollNotice'
3 |
4 | const useRollNotice = () => {
5 | const data = [
6 | '手机尾号1234的用户获得三等奖',
7 | '手机尾号7788的用户获得三等奖',
8 | '手机尾号3428的用户获得四等奖'
9 | ]
10 | return (
11 |
12 |
16 |
17 |
21 |
22 | )
23 | }
24 |
25 | export default useRollNotice
--------------------------------------------------------------------------------
/src/component/use/useTabSwitch.de:
--------------------------------------------------------------------------------
1 | import TabSwitch from 'TabSwitch'
2 |
3 | ...
4 | const c1 = (我的标签一的内容
)
5 | const c2 = (我的标签二的内容
)
6 | const c3 = (我的标签三的内容
)
7 |
8 | const panels = [
9 | {title: '列表一', content: c1},
10 | {title: '列表二', content: c2},
11 | {title: '列表三', content: c3}
12 | ]
13 | return (
14 |
15 | console.log(`上一页是${prev},下一页是${now}`)}
19 | />
20 |
21 | )
22 | ...
--------------------------------------------------------------------------------
/src/component/TabSwitch/demo.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import TabSwitch from '../TabSwitch'
3 |
4 | const useTabSwitch = () => {
5 | const c1 = (我的标签一的内容
)
6 | const c2 = (我的标签二的内容
)
7 | const c3 = (我的标签三的内容
)
8 |
9 | const panels = [
10 | {title: '列表一', content: c1},
11 | {title: '列表二', content: c2},
12 | {title: '列表三', content: c3}
13 | ]
14 | return (
15 |
16 | console.log(`上一页是${prev},下一页是${now}`)}
20 | />
21 |
22 | )
23 | }
24 |
25 | export default useTabSwitch
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "ecmaFeatures": {
3 | "jsx": true,
4 | "es6": true,
5 | "modules": true
6 | },
7 | "env": {
8 | "browser": true,
9 | "node": true,
10 | "mocha": true
11 | },
12 | "parser": "babel-eslint",
13 | "rules": {
14 | no-empty: ["error", { "allowEmptyCatch": true }],
15 | "strict": [2, "never"],
16 | "react/jsx-uses-react": "error",
17 | "react/jsx-uses-vars": "error",
18 | "no-console": ["error", { allow: ["warn", "error", "log", "info"] }]
19 | },
20 | "Options": "except-parens",
21 | "plugins": [
22 | "react"
23 | ],
24 | "extends": ["eslint:recommended", "plugin:react/recommended"]
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | var webpack = require('webpack');
2 | var WebpackDevServer = require('webpack-dev-server');
3 | var config = require('./webpack.config');
4 |
5 | const isDeveloping = process.env.NODE_ENV !== 'production';
6 | const port = isDeveloping ? 3000 : process.env.PORT;
7 |
8 | var compiler = webpack(config);
9 | var server = new WebpackDevServer(compiler, {
10 | publicPath: config.output.publicPath,
11 | hot: true,
12 | historyApiFallback: true,
13 | stats: {
14 | colors: true,
15 | hash: false,
16 | timings: true,
17 | chunks: false,
18 | chunkModules: false,
19 | modules: false
20 | }
21 | });
22 |
23 | server.listen(3000, 'localhost', function(err, result) {
24 | if (err) {
25 | return console.log(err);
26 | }
27 | console.log('Listening at http://localhost:3000/');
28 | });
--------------------------------------------------------------------------------
/src/component/use/useMarquee.de:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import Marquee from '../Marquee'
3 |
4 | class UseMarquee extends Component {
5 | constructor(props) {
6 | super(props)
7 | this.state ={
8 | prize: -1,
9 | startGame: false
10 | }
11 | }
12 | handleMarqueeStart() {
13 | //获取用户数据,开始游戏,改变 prize 值
14 | this.setState({
15 | startGame: true,
16 | prize: 6
17 | })
18 | }
19 | handleMarqueeResult() {
20 | //结束游戏,弹框提示获奖
21 | alert('恭喜你获得奖励'+this.state.prize)
22 | }
23 | render() {
24 | return (
25 |