Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zh-CN]: add translation for NavigationTransition #24858

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions files/zh-cn/web/api/navigationtransition/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: NavigationTransition
slug: Web/API/NavigationTransition
l10n:
sourceCommit: bb60fadaa7423d2195ae8727f197fa4361aa09df
---

{{APIRef("Navigation API")}}{{SeeCompatTable}}

{{domxref("Navigation API", "导航 API", "", "nocode")}} 的 **`NavigationTransition`** 接口表示正在进行的导航,即尚未到达 {{domxref("Navigation/navigatesuccess_event", "navigatesuccess")}} 或 {{domxref("Navigation/navigateerror_event", "navigateerror")}} 阶段的导航。

它是通过 {{domxref("Navigation.transition")}} 属性访问的。

{{InheritanceDiagram}}

## 实例属性

- {{domxref("NavigationTransition.finished", "finished")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : 返回一个 {{jsxref("Promise")}},其在 {{domxref("Navigation/navigatesuccess_event", "navigatesuccess")}} 事件触发时同时兑现,或 {{domxref("Navigation/navigateerror_event", "navigateerror")}} 事件触发时同时拒绝。
skyclouds2001 marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("NavigationTransition.from", "from")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : 返回导航过渡来源的 {{domxref("NavigationHistoryEntry")}}。
- {{domxref("NavigationTransition.navigationType", "navigationType")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : 返回正在进行的导航的类型。

## 示例

```js
async function cleanupNavigation() {
await navigation.transition.finished;
// 导航已成功完成
// 清理所有正在进行的监控
}
```

## 规范

{{Specifications}}

## 浏览器兼容性

{{Compat}}

## 参见

- [现代客户端路由:导航 API](https://developer.chrome.google.cn/docs/web-platform/navigation-api/)
- [导航 API 说明](https://github.com/WICG/navigation-api/blob/main/README.md)
- Domenic Denicola 的[导航 API 在线演示](https://gigantic-honored-octagon.glitch.me/)