chore(tabs): pass id to anchor link in Tab

This commit is contained in:
Eric Liu 2020-07-30 17:27:29 -07:00
commit 121768598c
2 changed files with 6 additions and 2 deletions

View file

@ -33,12 +33,16 @@
const tabsById = derived(tabs, (_) =>
_.reduce((a, c) => ({ ...a, [c.id]: c }), {})
);
const selectedTab = writable(undefined);
const content = writable([]);
const contentById = derived(content, (_) =>
_.reduce((a, c) => ({ ...a, [c.id]: c }), {})
);
const selectedContent = writable(undefined);
setContext("Tabs", {
tabs,
contentById,
selectedTab,
selectedContent,
add: (data) => {