UNPKG

weex-nuke

Version:

基于 Rax 、Weex 的高性能组件体系 ~~

22 lines (19 loc) 586 B
'use strict'; /** @jsx createElement */ import { Component, render, createElement } from 'rax'; import { isWeex } from 'nuke-env'; class Web extends Component { constructor(props) { super(props); } render() { const { style, src, ...others } = this.props; const width = style.width || 0; const height = style.height || 0; if (isWeex) { return <web ref="webview" src={src} style={style} width={width} height={height} {...others} />; } return <iframe ref="webview" src={src} style={style} frameBorder="0" {...others} />; } } export default Web;