Skip to content

Commit 4d04f95

Browse files
committed
refactor: 优化逻辑
1 parent d27ae94 commit 4d04f95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/BootstrapBlazor/Components/Layout/LayoutSplitebar.razor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export function init(id) {
2222
e => {
2323
section.classList.add('drag');
2424
const widthString = getComputedStyle(section).getPropertyValue('--bb-layout-sidebar-width');
25-
if (widthString === null) {
26-
section.setProperty('--bb-layout-sidebar-width', `0`);
25+
if (widthString === '') {
26+
section.style.setProperty('--bb-layout-sidebar-width', '0');
27+
widthString = '0';
2728
}
28-
widthString ??= '0';
2929
width = parseInt(widthString);
3030
originX = e.clientX || e.touches[0].clientX;
3131
},

0 commit comments

Comments
 (0)