diff --git a/src/components/QrItem.js b/src/components/QrItem.js index 272937b..0034d5d 100644 --- a/src/components/QrItem.js +++ b/src/components/QrItem.js @@ -20,6 +20,10 @@ class QrItem extends React.Component { this.props.onSelected(this.props.index); } + shouldComponentUpdate(nextProps, nextState, nextContext) { + return nextProps.selected || this.props.selected + } + render() { return (
diff --git a/src/components/Qrcode.js b/src/components/Qrcode.js index 3de4c29..ad2a12e 100644 --- a/src/components/Qrcode.js +++ b/src/components/Qrcode.js @@ -163,7 +163,7 @@ class Qrcode extends React.Component {
Downloads
-

下载二维码

+

下载二维码 - {styleList[this.state.selectedIndex].value}