Skip to content

Commit

Permalink
📝 docs(PageStack): update for the TabChanged event
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem committed Nov 6, 2024
1 parent 2dae275 commit a791d13
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"events": {
"PageClosed": "a event occurs when a stack page is closed"
"PageClosed": "a event occurs when a stack page is closed",
"TabChanged": "a event occurs when a tab is changed, it will not be triggered when a page is pushed or popped"
},
"methods": {
"Push": "push a new page onto the page stack",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"events": {
"PageClosed": "当堆栈页面关闭时触发"
"PageClosed": "当堆栈页面关闭时触发",
"TabChanged": "当选项卡更改时触发,页面入栈或出栈时不会触发"
},
"methods": {
"Push": "将新页面推送到页面堆栈",
Expand Down
5 changes: 5 additions & 0 deletions docs/Masa.Blazor.Docs/wwwroot/data/other-apis.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
{
"name": "PageClosed",
"type": "EventHandler<PageStackPageClosedEventArgs>"
},
{
"name": "TabChanged",
"type": "EventHandler<PageStackTabChangedEventArgs>",
"releasedOn": "v1.8.0"
}
],
"methods": [
Expand Down
9 changes: 9 additions & 0 deletions docs/Masa.Blazor.Docs/wwwroot/pages/labs/page-stack/en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ related:

### PageStackNavController

#### Methods

Used to control the navigation of the page stack.

| Method name | Description |
Expand All @@ -53,6 +55,13 @@ Used to control the navigation of the page stack.
<MButton OnClick="@(() => NavController.Push("/stack-page"))">Go to stack page</MButton>
```

#### Events {updated-in=v1.8.0}

| Event name | Description | Usage scenario |
|--------------|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| `PageClosed` | Triggered when the stack page is closed. | - |
| `TabChanged` | Triggered when the tab is switched, including system-level return. It will not be triggered when pushed or popped. | Reset some states of the old tab page when switching, such as popups. |

### data-page-stack-strategy

<app-alert type="warning" content="It is recommended to use the **PPageStackLink** component to avoid multiple triggers due to continuous clicks."></app-alert>
Expand Down
9 changes: 9 additions & 0 deletions docs/Masa.Blazor.Docs/wwwroot/pages/labs/page-stack/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ related:

### PageStackNavController

#### 方法 {#methods}

用于控制页面堆栈的导航。

| 方法名 | 说明 |
Expand All @@ -52,6 +54,13 @@ related:
<MButton OnClick="@(() => NavController.Push("/stack-page"))">Go to stack page</MButton>
```

#### 事件 {#events updated-in=v1.8.0}

| 事件名 | 说明 | 使用场景 |
|--------------|-------------------------------|----------------------|
| `PageClosed` | 堆栈页面关闭时触发。 | - |
| `TabChanged` | 选项卡切换时触发,包括系统级返回时。入栈或出栈时不会触发。 | 切换时重置旧tab页的某些状态,如弹窗。 |

### data-page-stack-strategy

<app-alert type="warning" content="建议使用 `PPageStackLink` 组件,以避免连续点击导致多次触发。"></app-alert>
Expand Down

0 comments on commit a791d13

Please sign in to comment.