[Partly re-render]
This commit is contained in:
parent
d32a40a7a6
commit
7b812f3469
|
@ -20,6 +20,10 @@ class QrItem extends React.Component {
|
||||||
this.props.onSelected(this.props.index);
|
this.props.onSelected(this.props.index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shouldComponentUpdate(nextProps, nextState, nextContext) {
|
||||||
|
return nextProps.selected || this.props.selected
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className={calClassName(this.props)} onClick={this.handleClick}>
|
<div className={calClassName(this.props)} onClick={this.handleClick}>
|
||||||
|
|
|
@ -163,7 +163,7 @@ class Qrcode extends React.Component {
|
||||||
<div className="Qr-titled">
|
<div className="Qr-titled">
|
||||||
<div className="Qr-Centered title-margin">
|
<div className="Qr-Centered title-margin">
|
||||||
<div className="Qr-s-title">Downloads</div>
|
<div className="Qr-s-title">Downloads</div>
|
||||||
<p className="Qr-s-subtitle">下载二维码</p>
|
<p className="Qr-s-subtitle">下载二维码 - {styleList[this.state.selectedIndex].value}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="Qr-Centered">
|
<div className="Qr-Centered">
|
||||||
<div className="div-btn">
|
<div className="div-btn">
|
||||||
|
|
Loading…
Reference in New Issue