Skip to content

Commit d976239

Browse files
committed
fix: issue with vue default props
1 parent af767e2 commit d976239

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

e2e/e2e-app/src/components/default-props/default-props.lite.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { useDefaultProps, useStore } from '@builder.io/mitosis';
2-
import { DefaultPropsState, DefaultPropsType } from './types';
32

4-
useDefaultProps<DefaultPropsType>({ foo: 'abc', bar: 'foo' });
3+
useDefaultProps({ foo: 'abc', bar: 'foo' });
54

6-
export default function DefaultProps(props: DefaultPropsType) {
7-
const state = useStore<DefaultPropsState>({
5+
export default function DefaultProps(props: any) {
6+
const state = useStore({
87
getProps: () => {
98
return JSON.stringify({ foo: props.foo, bar: props.bar });
109
},

e2e/e2e-app/src/components/default-props/types.ts

-8
This file was deleted.

packages/core/src/generators/vue/compositionApi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const getCompositionPropDefinition = ({
2020
let str = 'const props = ';
2121

2222
if (component.defaultProps) {
23-
const generic = isTs ? `<${component.propsTypeRef}>` : '';
23+
const generic = isTs && component.propsTypeRef !== 'any' ? `<${component.propsTypeRef}>` : '';
2424
const defalutPropsString = props
2525
.map((prop) => {
2626
const value = component.defaultProps!.hasOwnProperty(prop)

0 commit comments

Comments
 (0)