Mobile web app 组件库, 基于React@16.
npm install --save react-zui
import React from 'react';
import ReactDOM from 'react-dom';
import {Page, List} from 'react-zui';
const App = () => <Page title="hello page" className="hello-page">
<List>
<List.Item>
Hello World!
</List.Item>
</List>
</Page>;
ReactDOM.render((
<App/>
), document.getElementById('container'));
//index.js
import React from 'react'
import ReactDOM from 'react-dom'
import FastClick from 'fastclick'
import {HashRouter, BrowserRouter, Route, Switch} from 'react-router-dom'
import asyncComponent from './asyncComponent'
ReactDOM.render(
<HashRouter>
<Switch>
<Route exact path='/' component={asyncComponent(() => import('./pages/HomePage'))}/>
<Route exact path='/me' component={asyncComponent(() => import('./pages/MePage'))}/>
<Route exact path='/login' component={asyncComponent(() => import('./pages/LoginPage'))}/>
</Switch>
</HashRouter>,
document.getElementById('container')
)
FastClick.attach(document.body)
//HomePage.js
import React from 'react'
import {Page, List, Button} from 'react-zui'
export default class HomePage extends React.Component {
render = () => {
return <Page title="home">
<Button type="primary" padding="10px">
hello, this is home page.
</Button>
</Page>
}
}
//克隆到本地
git clone git@github.com:junlongtao/react-zui.git
//安装依赖
cd react-zui & npm install
//构建package
npm run packages-build
//构建doc及完整项目示例,自动打开浏览器,开始探索!
npm run start
email 782570386@qq.com
The MIT License(http://opensource.org/licenses/MIT)