我想知道使用this.setState({property: 1}) and
this.state.property = 1`
var App = React.createClass({
getInitialState: function(){
return({number: 0})
},
increaseNumber: function(){
this.state.number += 1;
},
decreaseNumber: function(){
this.setState({number: this.state.number - 1})
}
})
答案 0 :(得分:-1)
如果你这样做:
SELECT . . .
FROM Item i INNER JOIN
ItemClassComponent icc
ON icc.ItemID = i.ID INNER JOIN
ItemClass ic
ON ic.ID = icc.ItemClassID INNER JOIN
(SELECT _icc.ItemClassID, MAX(_i.LastUpdated) AS LastUpdated
FROM Item _i JOIN
ItemClassComponent _icc
ON _icc.ItemID = _i.ID
GROUP BY _icc.ItemClassID
) lu
ON lu.LastUpdated = i.LastUpdated AND lu.ItemClassId = ic.Id;
它是一个直接实现,但是如果你使用setter执行它,你可以处理异常或类似的东西,因为你将初始化值。在这种情况下,它并不重要。
我希望我能帮助你。 :)