Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Vue 3.3 slots short definition #3116

Merged
merged 1 commit into from
May 3, 2023

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented May 3, 2023

Issue: #2758

In order to support the slots short definition, we must have a ToTemplateSlots type conversion helper to convert the short definition into a legal slots type, but this makes it impossible to handle the generic type.

This is a Volar limitation, we temporarily removed ToTemplateSlots until we find a solution, you must fully define the slots type for now:

<script setup lang="ts">
defineSlots<{
-  foo: { id: string }
+  foo?: (props: { id: string }) => any
}>();
</script>

TS playground:

https://www.typescriptlang.org/play?#code/MYGwhgzhAEByD2AXA6vATgawDwBUB80A3gFDRnTDwB2EiaArsIugBQCURp53iAngA4BTaDng5BAW37hEggMogkEXAQC8RaAG0A0tACWVaBkG94AMxEBdAPwAuONVj0Q4AEYhBuHZYKCAHrJUACYwLAB0EWBoAOYQ9mBUvJqWHKoECbzQ1iLe0PYs-Gjw-HE52inQadAZ0AC+ANxc3GQeiNAQiogQAIT2ouJSMvKdyiTN41q6BkYm5iLVMLr+gSHtdAbRWdAABsCCLrYAJITatdt50FSCAG6CaJb2hNDXYCD0gn25DU3NtdAAZJwJs0goIzGBnIh7AAlQSUNBBLC0NAbAA01USeEawNqWJ+3EoNDaHSQlXaIzCoPBkMaAEhaXwhNAAJIQABqrz0QQUpPUjMEcxJbWWgmCoQiYSisXiiVS6USWzo7wu4JAEEE2ImAHotdwAHrWH61YjG4igSAwVCYFRA8iE5GMZhodi28atclKXqu4GTfSGYymCw4BbQJYBUWrZEbLa7fYgI4nM4XK63e75AD6j2er3en3KdTlGN4mvGf0BYx9ZCpEJAUOgLEz0Fh8MRUao0XRGTwhYyJd+fYJ1FoHra6iFEEpYJriDpDIEwlZHJAXJ5o+g-MFnWgIrF9YlUtKGR7CuySuE9lV6oH5B1+sN3GNxqAA

@jd-solanki
Copy link
Contributor

@chinbor Try removing vue-macros plugins from vueCompilerOptions in tsconfig.json and reload the vscode, I hope this will resolve your issue. I was also facing the same. Let me know if this resolves your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants