87,996
社区成员




function checkADDUser(){
var t = true;
$("#Huiform input").each(function(index, element) {
if($.trim($(this).val())==""){
$(this).focus(); t = false;
layer.msg('添加失败,请填写完整.')
return false;
}
else{
//alert('添加成功!');
//parent.location.reload();
// window.location.reload();
window.location.reload();
return false;
}
});
return t;
}
});
window.location.reload在安卓和鸿蒙系统中执行不会触发react的componentDidmount重新执行,只是会触发componentDidUpdate的执行,所以会引发很多的异常,使用了一下这些方法都不好使(IOS正常可以执行的,只是安卓和鸿蒙)
1,history.go(0)
2,location.reload()
3,location=location
4,location.assign(location)
5,document.execCommand('Refresh')
6,window.navigate(location)
7,location.replace(location)
8,document.URL=location.href
有效的方法是:
refresh = () => {
this.setstate({
// init state
}, () => {
this.componentDidMount();
});
}
就可以了