高仿美团h5 App
-- src
--- component
--- static
--- page
---- index 首页
----- actions //接口文件
----- reducers
----- Home // 大组件
------ Header // 细分组件
------- Header.jsx
------- Header.scss
----- index.html page的根html
----- index.js page的根js
----- store.js
-- dev // development时需要的静态数据
-- webpack.config.dev.js //多页面配置
- 适配 px转换为rem
// 使用的scss
@function px2rem($px) {
$rem: 37.5px;
@return ($px / $rem) + rem;
}
//在 webpack.config.XX.js中rules的sass loader中配置
或 安装 lib-flexible 和 px2rem 插件
- 适配html的font-size 在index.html 中引入/static/rem.js 订阅resize事件,根据document.documentElement.clientWidth / 10 来设置html的font-size(px)
- 安装依赖
yarn install
- 启动
yarn run dev
- 打包
yarn run build