React的分页实例来了!define(function(require,exports,module){
'use strict';
var React = require('reactAddons');
module.exports = React.createClass({
clickHandler:function(e){
e.preventDefault();
this.props.listData(e.currentTarget.dataset.page);
},
render:function(){
var cx = React.addons.classSet;
var preClass = cx({
'previous':true,
'disabled':this.props.pre_stop == true
});
var nextClass = cx({
'next':true,
'disabled':this.props.next_stop == true
});
return (
← Older
Newer →
);
}
});
});如何调用?render:function(){
var pager_props = {
page : this.state.page,
pre_stop:this.state.pre_stop,
next_stop:this.state.next_stop,
listData : this.listData
};
return (
);
}好了,不了解的可以加群进行交流,或者微博联系