From 11478f086522a9ffe38e62f3db77273b38304ed7 Mon Sep 17 00:00:00 2001 From: afeiship <1290657123@qq.com> Date: Wed, 31 Jul 2019 15:14:42 +0800 Subject: [PATCH] docs: new --- README.md | 115 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 92 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index ee2883c..81114d0 100644 --- a/README.md +++ b/README.md @@ -16,35 +16,104 @@ npm install -S afeiship/react-status-manager ``` 2. import js ```js - import React from 'react'; + import ReactStatusManager from '../src/main'; import ReactDOM from 'react-dom'; - import ReactStatusManager from 'react-status-manager'; - - // your app: - class App extends React.Component{ - render(){ + import React from 'react'; + import './assets/style.scss'; + + class App extends React.Component { + constructor(props) { + super(props); + this.state = { + value: 'init', + smvalue: 'N', + step: 0 + }; + } + + click1 = (e) => { + this.setState({ value: 'init' }); + console.log('click1'); + }; + click2 = (e) => { + this.setState({ value: 'active' }); + console.log('click2'); + }; + click3 = (e) => { + this.setState({ value: 'running' }); + console.log('click3'); + }; + click4 = (e) => { + this.setState({ value: 'finish' }); + console.log('click4'); + }; + + _click5 = (e) => { + this.setState({ + smvalue: 'A' + }); + }; + + _clickStep = (e) => { + let step = this.state.step; + this.setState({ + step: step === 3 ? 0 : step + 1 + }); + }; + + render() { return ( - - ) +
+ + 下拉刷新 + 释放更新 + + 更新完毕 + + + + 未开始 + 进行中 + 已经结束 + + + + + + + + + +

Wizard

+ + +
step1,input password
+
step2,input phone
+
step3,input other info
+
+ step4,do submit! +
+
+
+ ); } } - // render to dom: - ReactDOM.render(, document.getElementById('app')); + ReactDOM.render(, document.getElementById('app')); + ``` ## documentation - https://afeiship.github.io/react-status-manager/ - -## resouces -- https://www.robinwieruch.de/minimal-react-webpack-babel-setup/ -- https://www.valentinog.com/blog/react-webpack-babel/ -- https://jestjs.io/docs/en/tutorial-react#snapshot-testing-with-mocks-enzyme-and-react-16 -- https://testing-library.com/docs/react-testing-library/api - -## todos -- [ ] Add: semver number for every build files. -- [ ] Add: need output css files. -- [ ] Add: PWA support for docs. -- [ ] Add: source.map file for dist(`you can upload for production debug`). -- [ ] BUG: npm run dev will clean dist.