首页 > Web开发 > 详细

React.js 样式组件:React Style

时间:2015-04-07 15:22:54      阅读:523      评论:0      收藏:0      [点我收藏+]

技术分享点这里

 

React Style 是 React.js 可维护的样式组件。使用 React Native StyleSheet.create一样的样式。

完全使用 JavaScript 定义样式:

1
2
3
4
5
6
7
var StyleSheet = require(‘react-style‘)
var styles = StyleSheet.create({
    foo: {
      color: ‘red‘,
      backgroundColor: ‘white‘
    }
})

样式 React 组件:

1
2
3
4
5
6
7
8
9
10
var React = require(‘react‘)
 
class HelloWorld extends React.Component{
 
  render() {
    var dynamicStyles = {color: this.props.color}
    return <div styles={[styles.foo, dynamicStyles]}>Hello, world!</div>
  }
 
}

 

https://github.com/js-next/react-style

 

React.js 样式组件:React Style

原文:http://www.cnblogs.com/RTdo/p/4398262.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!