UNPKG

weex-nuke

Version:

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

33 lines (25 loc) 590 B
/** @jsx createElement */ import { Component, createElement, render } from 'rax'; import View from 'nuke-view'; class Col extends Component { render() { const style = { ...styles.initial, ...this.props.style, }; const children = this.props.children; const length = children.length; if (length) { return <View {...this.props} style={style} />; } children.props.style = Object.assign({}, style, children.props.style); return children; } } const styles = { initial: { flex: 1, display: 'flex', }, }; export default Col;