NavigationTransition:navigationType 属性
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
NavigationTransition
接口的 navigationType
只读属性返回正在进行的导航的类型。
值
表示正在进行的导航类型的枚举值。
可能的值包括:
push
:导航到新位置,导致将新条目推送到历史记录列表中。reload
:重新加载Navigation.currentEntry
。replace
:用新的历史记录条目替换Navigation.currentEntry
。此新条目将重用相同的key
,但分配不同的id
。traverse
:浏览器从一个现有历史记录条目导航到另一个现有历史记录条目。
示例
js
console.log(navigation.transition.navigationType);
规范
Specification |
---|
HTML # dom-navigationtransition-navigationtype-dev |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
navigationType |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
参见
- 现代客户端路由:导航 API
- 导航 API 说明
- Domenic Denicola 的导航 API 在线演示