文章目录
  1. 安装create-react-app,创建React工程
    npm install -g create-react-app, // 安装
    create-react-app my-app // 创建
    进入my-app,并 npm start 后可以在http://localhost:3000/ 实时查看界面修改
  2. 编译生成部署工程
    npm run build

  3. 用到的库
    react-modal:对话框库,官方的 https://github.com/reactjs/react-modal
    boron:对话框库,支持多种动画,但在ios上显示有问题 https://github.com/yuanyan/boron
    whatwg-fetch:网络请求库 https://github.com/github/fetch

1
2
3
4
5
6
遇到的坑:
1. justifyContent不支持
2. img的src属性需要require("xxxx"),且图片目录要放到src目录下,
3. backgroundImage样式目前没有找到使用工程图片的方法,使用网络图片应这样写:backgroundImage: 'url('+xxxurl+')',(未试过)
4. span等行布局的,要设置display为block时,paddingttop,paddingbottom才有效
5. html中事件onclick等于属性onClick,其他类似.
文章目录