weex-nuke
Version:
基于 Rax 、Weex 的高性能组件体系 ~~
34 lines (24 loc) • 546 B
Markdown
# Helper
- category: Components
- chinese: 辅助函数
- type: 基本
## API
### calcTextSize
解析固定字号,`<Text style={{fontSize: 28}}>123</Text>` 希望字号被解析为:
```
web: 14px;
native iOS: 14 dp;
native android: 14 pt;
```
```
const { calcTextSize } = Helper;
let style = {fontSize: 28};
calcTextSize(style);
```
### hairLine for web
```
const { hairLine } = Helper;
hairLine.detect() // 是否支持 hairline,返回 true 或 false
hairLine.fixBorder({ borderWidth: 1 }) // ==> {"borderWidth":"0.5px"}
```