Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
activity-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liupengfei
activity-core
Commits
54bc4f2b
Commit
54bc4f2b
authored
Jul 14, 2020
by
liupengfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新readme
parent
10059a8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
26 deletions
+12
-26
README.md
README.md
+12
-26
No files found.
README.md
View file @
54bc4f2b
<!--
*
@Author: flyharvest
*
@Date: 2020-07-08 17:22:20
*
@LastEditTime: 2020-07-
08 17:38:4
0
*
@LastEditTime: 2020-07-
14 15:08:3
0
*
@LastEditors: flyharvest
-->
# @
tuia/flexibl
e
flexible by rem
# @
acitivity/cor
e
推啊公共库
# Usage
```
javascript
/**
*
根据项目,设置页面禁止缩放
*
创建新的开发包
*/
rem
.
setViewPort
()
yarn
run
create
myPackage
/**
* 初始化
* aw 适配尺寸,默认值 750,大部分项目是640
* dw 设计尺寸,默认值750,大部分项目是750
* 开发某个仓库, 使用webpack构建,
* 使用test/myPackage/index.html 作为 模板(如果没有就用 test/public 作为html模板)
* 使用test/myPackage/index.js 作为入口文件。
* import xxx from '@lib/myPackage' 其中 @lib 是 src 的别名。
*/
rem
.
init
(
750
,
750
)
lib
=
myPackage
yarn
serve
/**
*
获取当前根字体大小
*
使用rollup构建
*/
console
.
log
(
'当前根字体大小 '
+
rem
.
getFontSize
())
yarn
build
/**
* 获取设计尺寸
*/
console
.
log
(
'设计尺寸为 '
+
rem
.
getDesignWidth
())
/**
* px => rem
*/
console
.
log
(
'750px 对应rem '
+
rem
.
px2rem
(
750
))
console
.
log
(
'750px 对应rem '
+
rem
.
px2rem
(
'750px'
))
/**
* rem => px
*/
console
.
log
(
'3.75rem 对应px '
+
rem
.
rem2px
(
3.75
))
console
.
log
(
'3.75rem 对应px '
+
rem
.
rem2px
(
'3.75rem'
))
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment