From 7fa1f2abb92aa660a0f2e3e70a69d98c2976a19a Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:52:01 +0800 Subject: [PATCH 1/2] [zh-CN]: add translation for `Navigation.transition` --- .../web/api/navigation/activation/index.md | 6 +-- .../web/api/navigation/currententry/index.md | 6 +-- .../web/api/navigation/transition/index.md | 40 +++++++++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 files/zh-cn/web/api/navigation/transition/index.md diff --git a/files/zh-cn/web/api/navigation/activation/index.md b/files/zh-cn/web/api/navigation/activation/index.md index 104ac918934278..8bea1152a536ef 100644 --- a/files/zh-cn/web/api/navigation/activation/index.md +++ b/files/zh-cn/web/api/navigation/activation/index.md @@ -31,6 +31,6 @@ if (navigation.activation) { ## 参见 -- [现代客户端路由:Navigation API](https://developer.chrome.google.cn/docs/web-platform/navigation-api/) -- [Navigation API 说明](https://github.com/WICG/navigation-api/blob/main/README.md) -- Domenic Denicola 的 [Navigation API 在线示例](https://gigantic-honored-octagon.glitch.me/) +- [现代客户端路由:导航 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/) diff --git a/files/zh-cn/web/api/navigation/currententry/index.md b/files/zh-cn/web/api/navigation/currententry/index.md index b314b97ccb41a7..cb98de645d4474 100644 --- a/files/zh-cn/web/api/navigation/currententry/index.md +++ b/files/zh-cn/web/api/navigation/currententry/index.md @@ -43,6 +43,6 @@ navigation.addEventListener("navigate", (event) => { ## 参见 -- [现代客户端路由:Navigation API](https://developer.chrome.google.cn/docs/web-platform/navigation-api/) -- [Navigation API 说明](https://github.com/WICG/navigation-api/blob/main/README.md) -- Domenic Denicola 的 [Navigation API 在线示例](https://gigantic-honored-octagon.glitch.me/) +- [现代客户端路由:导航 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/) diff --git a/files/zh-cn/web/api/navigation/transition/index.md b/files/zh-cn/web/api/navigation/transition/index.md new file mode 100644 index 00000000000000..740a8c75068e9c --- /dev/null +++ b/files/zh-cn/web/api/navigation/transition/index.md @@ -0,0 +1,40 @@ +--- +title: Navigation:transition 属性 +slug: Web/API/Navigation/transition +l10n: + sourceCommit: ef75c1741b450c2331204be5563ee964ad5f4c48 +--- + +{{APIRef("Navigation API")}}{{SeeCompatTable}} + +{{domxref("Navigation")}} 接口的 **`transition`** 只读属性返回一个 {{domxref("NavigationTransition")}} 对象,该对象表示正在进行的导航的状态,可用于跟踪正在进行的导航。 + +## 值 + +{{domxref("NavigationTransition")}} 对象,如果当前没有正在进行的导航,则为 `null`。 + +## 示例 + +```js +async function handleTransition() { + if (navigation.transition) { + showLoadingSpinner(); + await navigation.transition.finished; + hideLoadingSpinner(); + } +} +``` + +## 规范 + +{{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/) From 3e9af899d0dcfca293836d72337a328f4c054d66 Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:28:05 +0800 Subject: [PATCH 2/2] fixes --- files/zh-cn/web/api/navigation/activation/index.md | 2 +- files/zh-cn/web/api/navigation/currententry/index.md | 2 +- files/zh-cn/web/api/navigation/index.md | 2 +- files/zh-cn/web/api/navigation/transition/index.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/zh-cn/web/api/navigation/activation/index.md b/files/zh-cn/web/api/navigation/activation/index.md index 8bea1152a536ef..13e1d2a857f039 100644 --- a/files/zh-cn/web/api/navigation/activation/index.md +++ b/files/zh-cn/web/api/navigation/activation/index.md @@ -33,4 +33,4 @@ if (navigation.activation) { - [现代客户端路由:导航 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/) +- Domenic Denicola 的[导航 API 在线示例](https://gigantic-honored-octagon.glitch.me/) diff --git a/files/zh-cn/web/api/navigation/currententry/index.md b/files/zh-cn/web/api/navigation/currententry/index.md index cb98de645d4474..1b7107aec88ab9 100644 --- a/files/zh-cn/web/api/navigation/currententry/index.md +++ b/files/zh-cn/web/api/navigation/currententry/index.md @@ -45,4 +45,4 @@ navigation.addEventListener("navigate", (event) => { - [现代客户端路由:导航 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/) +- Domenic Denicola 的[导航 API 在线示例](https://gigantic-honored-octagon.glitch.me/) diff --git a/files/zh-cn/web/api/navigation/index.md b/files/zh-cn/web/api/navigation/index.md index b3591bf3f8a048..013ff7feba8c7c 100644 --- a/files/zh-cn/web/api/navigation/index.md +++ b/files/zh-cn/web/api/navigation/index.md @@ -127,4 +127,4 @@ navigation.updateCurrentEntry({ state: newState }); - [现代客户端路由:导航 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/) +- Domenic Denicola 的[导航 API 在线示例](https://gigantic-honored-octagon.glitch.me/) diff --git a/files/zh-cn/web/api/navigation/transition/index.md b/files/zh-cn/web/api/navigation/transition/index.md index 740a8c75068e9c..c5b37884f70c5c 100644 --- a/files/zh-cn/web/api/navigation/transition/index.md +++ b/files/zh-cn/web/api/navigation/transition/index.md @@ -37,4 +37,4 @@ async function handleTransition() { - [现代客户端路由:导航 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/) +- Domenic Denicola 的[导航 API 在线示例](https://gigantic-honored-octagon.glitch.me/)