一个简单的计数器,可以'加一','减一'和'重置'
- 克隆仓库
git clone git@github.com:tangweikun/happy-clicker.git
- 安装依赖包
cd happy-clicker
yarn | npm install
- 本地运行
yarn start | npm run start
- 在浏览器中打开http://localhost:3000查看效果
library | version |
---|---|
react |
16.11.0 |
react-dom |
16.11.0 |
react-scripts |
3.2.0 |
gh-pages |
2.1.1 |
- 添加
homepage
到package.json
"homepage": "https://myusername.github.io/my-app",
- 安装
gh-pages
yarn add gh-pages
- 在
package.json
中添加部署脚本
"scripts": {
+ "predeploy": "npm run build",
+ "deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
- 执行
yarn deploy
yarn deploy
- 打开
https://myusername.github.io/my-app
查看效果