componentWillMount() {
const _self = this;
var qs = (location.search.length>0?location.search.substring(1):"");
var args = {};
var items = qs.length?qs.split("&"):[];
var item = null;
var name = null;
var value = null;
var len = items.length;
for (var i = 0; i < len; i++) {
item = items[i].split("=");
name = decodeURIComponent(item[0]);
value = decodeURIComponent(item[1]);
if (name.length) {
args[name] = value;
}
}
let keyValue = args['key'];
console.log('渲染开始之前 == ', keyValue)
_self.setState({
//url: 'http://static.kube.univer'+keyValue,
})
}
<div
className={'image_describe'}
>
<div className={'image_describe_information'}>
<div>图片尺寸</div>
<div
>{image}</div>
</div>
</div>
加载图片的速度主要看网速。
还有永远不要在componentWillMount里调用setState