Skip to content

Commit 119f4b8

Browse files
committed
feat(core): [styled] support passing custom props and no need definition
1 parent e488ae0 commit 119f4b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/core/src/styled.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function baseStyled<P extends Record<string, any>>(target: string | InstanceType
7272
let context = {
7373
theme,
7474
...props,
75+
...props.props,
7576
}
7677

7778
const defaultClassName = generateClassName()
@@ -93,6 +94,7 @@ function baseStyled<P extends Record<string, any>>(target: string | InstanceType
9394
context = {
9495
theme,
9596
...props,
97+
...props.props,
9698
}
9799
tailwindClasses.value = injectStyle<T & { theme: DefaultTheme }>(defaultClassName, cssWithExpression, context)
98100
},
@@ -127,6 +129,9 @@ function baseStyled<P extends Record<string, any>>(target: string | InstanceType
127129
as: {
128130
type: String as PropType<SupportedHTMLElements>,
129131
},
132+
props: {
133+
type: Object as PropType<P>,
134+
},
130135
...propsDefinition,
131136
},
132137
inheritAttrs: true,

0 commit comments

Comments
 (0)