Closed amritk closed 8 months ago
Yikes, seems like this isn't unique to cva
I'm not sure I like the idea of having to patch around this just because Vue's compiler doesn't support it 🤔
But then it wouldn't be working at all in vue right? Has it been working?
There are CI checks in place for Vue and nothing has flagged up https://github.com/joe-bell/cva/blob/main/.github/workflows/ci.yml#L20
There's also an example, and nothing has flagged up https://stackblitz.com/edit/joe-bell-cva-ocexjv?file=src%2Fcomponents%2FButton.vue
I don't really like the idea of changing something that seems to be working fine for all other TypeScript-based frameworks just because Vue's compiler has a specific use-case 😕
Yes thats true, let me see why the examples working
So the problem was with trying to this
withDefaults(
defineProps<
{
title?: string
} & FlowAlertProps
>(),
{
type: 'info',
},
)
instead of this
withDefaults(
defineProps<{
title?: string
type: FlowAlertProps['type']
}>(),
{
type: 'info',
},
)
Thanks for the help @joe-bell
Describe the bug When using CVA (both beta and the stable version) with vue SFC I get an error:
To Reproduce Checkout https://github.com/amritk/cva-error Its a new create vue app with cva added
Expected behavior No error
Screenshots![image](https://github.com/joe-bell/cva/assets/2039539/866384e9-b739-417a-9789-e0aeb8e88c3f)
Desktop (please complete the following information):
Additional context Looks like there is an open vue issue and PR