location.reload(true)已过时 [英] location.reload(true) is deprecated
本文介绍了location.reload(true)已过时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道重新加载Angular单页应用程序不是理想的.但是,我需要重新加载整个应用程序.
I know that it is not ideal to reload an Angular Single Page Application. However there is a place that I need to reload the full application.
TSLint说不建议重新加载.
TSLint says that reload is deprecated.
还有其他选择吗?
推荐答案
您可以使用不带forceReload标志的 location.reload()
.只是不赞成使用,因为它不在规范中: https://www.w3.org/TR/html50/browsers.html#dom-location-reload
You can use location.reload()
without the forceReload flag.
This is just deprecated because it is not in the spec: https://www.w3.org/TR/html50/browsers.html#dom-location-reload
这篇关于location.reload(true)已过时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文