weex-nuke
Version:
基于 Rax 、Weex 的高性能组件体系 ~~
53 lines (44 loc) • 1.19 kB
Markdown
# ep-util 基础使用
* order: 0
基本方法
---
```js
/** @jsx createElement */
import { createElement, Component, render } from 'rax';
import Text from 'nuke-text';
import Page from 'nuke-page';
import { Detection } from 'nuke-ep-utils';
let App = class NukeDemoIndex extends Component {
constructor() {
super();
}
renderParamInfo = () => {
return Object.keys(Detection).map(key => {
if (typeof Detection[key] === 'function') return;
const str = ` - [${key}] ${Detection[key]}`;
return <Text style={styles.resultText}>{str}</Text>;
});
};
render() {
const param = { verison: '8.0.0', isCheckOS: true };
return (
<Page title="ep-utils">
<Page.Intro main="Detection" sub="Detection基础信息" />
{this.renderParamInfo()}
<Page.Intro main="Detection" sub="比较版本" />
<Text style={styles.resultText}>
当前osVersion:{Detection.osVersion}>{param.version} {Detection.gt(param.version, param.isCheckOS)}
</Text>
</Page>
);
}
};
const styles = {
resultText: {
fontSize: '28rem',
lines: 5,
wordBreak: 'break-all',
},
};
render(<App />);
```