[Doc] add rem guide (#928)

This commit is contained in:
neverland
2018-04-24 17:49:26 +08:00
committed by GitHub
parent effc9591a3
commit 734e885727
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -68,3 +68,9 @@ Vue.use(Vant);
```shell
vue init youzan/vue-cli-template-vant projectName
```
### rem units
Vant use `px` as size units by defaultyou can use tools such as `postcss-pxtorem` to transform units to `rem`.
- [postcss-pxtorem](https://github.com/cuth/postcss-pxtorem)
- [lib-flexible](https://github.com/amfe/lib-flexible)
+6
View File
@@ -69,3 +69,9 @@ Vue.use(Vant);
```shell
vue init youzan/vue-cli-template-vant projectName
```
### rem 适配
Vant 中的组件样式默认使用`px`作为单位,如果需要使用`rem`作为单位,推荐使用以下两个工具
- [postcss-pxtorem](https://github.com/cuth/postcss-pxtorem) 用于将单位转化为 rem
- [lib-flexible](https://github.com/amfe/lib-flexible) 用于设置 rem 基准值