popbean-react
Version:
let me think about something,comming soon...
28 lines • 770 B
JSX
var React = require('react');
var ActionButton = React.createClass({
getDefaultProps:function(){
return {
model:{
type:"action"
}
};
},
render:function(){
var item = this.props.model;
var type = item.type || this.props.type || 'action';
if(type == 'action'){
return (
<button type="button" className="btn btn-default" onClick={item.handler || this.props.handler}>
<span className={item.icon || this.props.icon} aria-hidden="true"></span> {item.label || this.props.label}
</button>
);
}else{
return (
<button type="button" className="btn btn-default" onClick={item.handler || this.props.handler}>
<span className={item.icon || this.props.icon}></span>
</button>
);
}
}
});
module.exports=ActionButton;