diff --git a/CHANGELOG.md b/CHANGELOG.md index a5e52cb5a9136f5093358128c8e83bfd4a38a7ee..4d1572ec083b9ab765ddaa2a0673e4cd653584e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ ## [Unreleased] +### Changed + +- 优化分页导航面板部件计数器,将其迁移到控制器中处理 + ## [0.7.41-alpha.36] - 2025-11-10 ### Added diff --git a/src/control/tab-exp-panel/tab-exp-panel.tsx b/src/control/tab-exp-panel/tab-exp-panel.tsx index 2bb03ca66ba08c81f3c4303e0aa5ea590b4644a0..47902fe069c60896be52165867a91a274bd2769e 100644 --- a/src/control/tab-exp-panel/tab-exp-panel.tsx +++ b/src/control/tab-exp-panel/tab-exp-panel.tsx @@ -4,15 +4,7 @@ import { useControlController, useNamespace, } from '@ibiz-template/vue3-util'; -import { - defineComponent, - onUnmounted, - PropType, - Ref, - ref, - VNode, - watch, -} from 'vue'; +import { defineComponent, PropType, VNode, watch } from 'vue'; import { IAppDETabExplorerView, ITabExpPanel } from '@ibiz/model-core'; import './tab-exp-panel.scss'; import { @@ -53,22 +45,6 @@ export const TabExpPanelControl = defineComponent({ ); const ns = useNamespace(`control-${c.model.controlType!.toLowerCase()}`); - const counterData: Ref = ref({}); - - const fn = (counter: IData): void => { - counterData.value = counter; - }; - - c.evt.on('onCreated', () => { - if (c.counter) { - c.counter.onChange(fn, true); - } - }); - - onUnmounted(() => { - c.counter?.offChange(fn); - }); - const handleTabChange = (): void => { c.handleTabChange(); }; @@ -112,12 +88,11 @@ export const TabExpPanelControl = defineComponent({ c, ns, tabPosition, - counterData, handleTabChange, }; }, render() { - const { isCreated, tabPages } = this.c.state; + const { isCreated, tabPages, counterData } = this.c.state; return ( {isCreated && ( @@ -128,7 +103,7 @@ export const TabExpPanelControl = defineComponent({ > {tabPages.map(tab => { const counterNum = tab.counterId - ? this.counterData[tab.counterId] + ? counterData[tab.counterId] : undefined; return (