// 页面跳转
window.location.href = 'www.baidu.com'
// 页面刷新
window.location.reload()
// 获取当前网络状态,只能判断用户电脑有没有断网(包括无线和有线),有网为true,没有网为false
navigator.onLine
React 从入门到精通 (页面跳转、刷新及获取网络状态)
猜你喜欢
转载自blog.csdn.net/qq_33029793/article/details/103591788
今日推荐
周排行