$ npm install driver-universal
Driver for Universal App.
Support both DOM(Web) and Weex, with normalized 750rpx support of screen width.
$ npm install --save driver-universal
import { createElement, render } from 'rax';
import View from 'rax-view';
import Image from 'rax-image';
import DriverUniversal from 'driver-universal';
function Example() {
return (
<View>
<Image width="560" height="560" src="https://img.alicdn.com/tps/TB1z.55OFXXXXcLXXXXXXXXXXXX-560-560.jpg" />
</View>
);
}
render(<Example />, null, {
driver: DriverUniversal
});
| driver | append unit to relevant styles | 'rpx' translate | Compatible with flex | Compatible with event |
|---|---|---|---|---|
| driver-dom | Append 'px' | Translate to 'vw' | Do nothing | Do nothing |
| driver-weex | Use 'px' that relative to the width of the screen. | Do nothing | Do nothing | Do nothing |
| driver-universal | Append 'rpx' | Use 'px' that relative to the width of the screen, In weex | Support parsing array like display: ["-webkit-box", "-webkit-flex", "flex"] | Support input doubleclick |
© 2010 - cnpmjs.org x YWFE | Home | YWFE