enhance(view):加入视图切换功能。

This commit is contained in:
徐涛
2023-03-08 18:50:20 +08:00
parent 8b5b714d70
commit 6e5c9c5c5f
2 changed files with 8 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ interface ZoomState {
type ZoomActions = {
zoom: SyncObjectCallback<number>;
updateViewHeight: SyncObjectCallback<number>;
switchViewMode: SyncObjectCallback<'single' | 'double' | 'continuation'>;
};
const initialState: ZoomState = {
@@ -33,5 +34,10 @@ export const useZoomState = createStoreHook<ZoomState & ZoomActions>(set => ({
set(df => {
df.viewHeight = height;
});
},
switchViewMode(mode) {
set(df => {
df.viewMode = mode;
});
}
}));