diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f3f513137021badad755250d5f152c4d7ffe93b..14118bbd13c2c1c980d68fd33472abda9d9bec10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Added - 编辑视图识别是否开启脏检查配置,模型默认为关闭状态 +- 浏览器标签页标题跟随路由修改支持 ### Changed diff --git a/src/control/caption-bar/caption-bar.tsx b/src/control/caption-bar/caption-bar.tsx index 4517f1c198c0052f0a970467161285ef68e2ee0d..8d9c0f83d027ce1126b740310efa37268965f6ec 100644 --- a/src/control/caption-bar/caption-bar.tsx +++ b/src/control/caption-bar/caption-bar.tsx @@ -1,5 +1,5 @@ import { useControlController, useNamespace } from '@ibiz-template/vue3-util'; -import { defineComponent, PropType } from 'vue'; +import { defineComponent, PropType, onActivated } from 'vue'; import { ICaptionBar } from '@ibiz/model-core'; import './caption-bar.scss'; import { CaptionBarController, IControlProvider } from '@ibiz-template/runtime'; @@ -21,6 +21,18 @@ export const CaptionBarControl = defineComponent({ ); const ns = useNamespace(`control-${c.model.controlType!.toLowerCase()}`); + const modalMode = c.view.modal.mode; + + if (modalMode === 'ROUTE') { + ibiz.util.setBrowserTitle(c.state.caption); + } + + onActivated(() => { + if (modalMode === 'ROUTE') { + ibiz.util.setBrowserTitle(c.state.caption); + } + }); + return { c, ns }; }, render() { diff --git a/src/panel-component/nav-pos-index/nav-pos-index.controller.ts b/src/panel-component/nav-pos-index/nav-pos-index.controller.ts index 756c092d02c9b2e0f639265e3f6b1ea317b338a0..4d116cd55a6710768d9b0e8a19b9a52576e22154 100644 --- a/src/panel-component/nav-pos-index/nav-pos-index.controller.ts +++ b/src/panel-component/nav-pos-index/nav-pos-index.controller.ts @@ -313,6 +313,7 @@ export class NavPosIndexController extends PanelItemController { }`; } this.router!.push(indexPath); + ibiz.util.setBrowserTitle(''); } } }