use children instead of items on Stacks (#240)

This commit is contained in:
end-4
2024-02-06 07:53:34 +07:00
parent 1d6623cb57
commit 0186fc016c
2 changed files with 15 additions and 4 deletions
+4 -1
View File
@@ -30,7 +30,10 @@ let currentTabId = 0;
export const contentStack = Stack({
vexpand: true,
transition: 'slide_left_right',
items: contents.map(item => [item.name, item.content]),
children: contents.reduce((acc, item) => {
acc[item.name] = item.content;
return acc;
}, {}),
})
function switchToTab(id) {