plain-design 1.0.0-beta.13 → 1.0.0-beta.14
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
import {designComponent, mergeAttrs, nextTick, PropType, reactive, useStyles, watch} from "plain-design-composition";
|
1
|
+
import {designComponent, mergeAttrs, nextTick, PropType, reactive, RenderNode, useStyles, watch} from "plain-design-composition";
|
2
2
|
import {PlTabComponent} from "../Tab";
|
3
3
|
|
4
4
|
export const TabsInner = designComponent({
|
5
5
|
props: {
|
6
6
|
item: { type: Object as PropType<PlTabComponent>, required: true },
|
7
7
|
active: { type: Boolean },
|
8
|
+
render: { type: Function as PropType<() => RenderNode>, required: true }
|
8
9
|
},
|
9
10
|
slots: ['default'],
|
10
11
|
setup({ props, slots }) {
|
@@ -51,7 +52,7 @@ export const TabsInner = designComponent({
|
|
51
52
|
{ class: 'inner-tab', style: styles.value },
|
52
53
|
props.item.attrs
|
53
54
|
)}>
|
54
|
-
{!!state.init &&
|
55
|
+
{!!state.init && props.render()}
|
55
56
|
</div>
|
56
57
|
)
|
57
58
|
};
|
@@ -101,9 +101,7 @@ export const TabGroup = designComponent({
|
|
101
101
|
const body = (
|
102
102
|
<div className="tabs-body">
|
103
103
|
{[...tabs.value].sort((a, b) => String(a.val).localeCompare(String(b.val))).map((tab, index) => (
|
104
|
-
<TabsInner item={tab.item} key={index} active={tab.active}
|
105
|
-
{tab.item.slots.default()}
|
106
|
-
</TabsInner>
|
104
|
+
<TabsInner item={tab.item} key={index} active={tab.active} render={() => tab.item.slots.default()}/>
|
107
105
|
))}
|
108
106
|
</div>
|
109
107
|
);
|