Skip to content

Commit 554eafa

Browse files
committed
refactor: 增加主题响应式逻辑
1 parent c8c12b6 commit 554eafa

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { addLink } from '../../BootstrapBlazor/modules/utility.js'
22
import { cerateDockview } from '../js/dockview-utils.js'
33
import Data from '../../BootstrapBlazor/modules/data.js'
4+
import EventHandler from "../../BootstrapBlazor/modules/event-handler.js"
45

56
export async function init(id, invoke, options) {
67
await addLink("./_content/BootstrapBlazor.DockView/css/dockview-bb.css")
@@ -24,6 +25,8 @@ export async function init(id, invoke, options) {
2425
dockview.on('groupSizeChanged', () => {
2526
invoke.invokeMethodAsync(options.splitterCallback);
2627
});
28+
29+
EventHandler.on(document, 'changed.bb.theme', updateTheme);
2730
}
2831

2932
export function update(id, options) {
@@ -57,6 +60,8 @@ export function dispose(id) {
5760
Data.remove(id);
5861

5962
if (dock) {
63+
EventHandler.off(document, 'changed.bb.theme', dock.updateTheme);
64+
6065
const { dockview } = dock;
6166
if (dockview) {
6267
dockview.dispose();

0 commit comments

Comments
 (0)