fix js
This commit is contained in:
parent
966a0ce4b0
commit
6af62ae37e
|
|
@ -44,11 +44,16 @@ const Tabs = define('Tabs', {
|
||||||
render({ props, parts: { Root, Tab } }) {
|
render({ props, parts: { Root, Tab } }) {
|
||||||
return (
|
return (
|
||||||
<Root>
|
<Root>
|
||||||
|
<script dangerouslySetInnerHTML={{
|
||||||
|
__html: `
|
||||||
|
const ClickTab = (label) => console.log('Tab clicked:', label)
|
||||||
|
`}} />
|
||||||
|
|
||||||
{props.items?.map((item: any) => (
|
{props.items?.map((item: any) => (
|
||||||
<Tab
|
<Tab
|
||||||
key={item.id}
|
key={item.id}
|
||||||
active={item.active}
|
active={item.active}
|
||||||
onClick={() => console.log('Tab clicked:', item.label)}
|
onClick={`ClickTab("${item.label}")`}
|
||||||
>
|
>
|
||||||
{item.label}
|
{item.label}
|
||||||
</Tab>
|
</Tab>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user