From 4ea4ccf32870033b2a4b9a0abeeb02476f7bfcac Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 23 Aug 2024 13:42:20 +0800 Subject: [PATCH] * sidebar: fix preserve collapse state not work in sidebar. --- lib/sidebar/dev.ts | 3 ++- lib/sidebar/src/vanilla/sidebar.ts | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sidebar/dev.ts b/lib/sidebar/dev.ts index eaa6ef28e9..b1a7173218 100644 --- a/lib/sidebar/dev.ts +++ b/lib/sidebar/dev.ts @@ -2,7 +2,7 @@ import 'zui-dev'; import {Sidebar} from './src/main'; onPageUpdate(() => { - const sidebar = new Sidebar('#sidebar', {width: 300, parent: 'body'}); + const sidebar = new Sidebar('#sidebar', {width: 300, parent: 'body', preserve: 'sidebar'}); console.log('> sidebar', sidebar); const sidebarRight = new Sidebar('#sidebarRight', { @@ -11,6 +11,7 @@ onPageUpdate(() => { parent: 'body', side: 'right', animation: 1000, + preserve: 'sidebarRight', // toggleBtn: false, }); console.log('> sidebarRight', sidebarRight); diff --git a/lib/sidebar/src/vanilla/sidebar.ts b/lib/sidebar/src/vanilla/sidebar.ts index 19307d7bfc..e7c1c69fb4 100644 --- a/lib/sidebar/src/vanilla/sidebar.ts +++ b/lib/sidebar/src/vanilla/sidebar.ts @@ -91,8 +91,7 @@ export class Sidebar extends Component