Repository navigation
Replies: 2 comments
|
Hello, I'm late to the party but I just figured this one out <script setup lang="ts">
interface Props {
reverse?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
reverse: false
});
</script>
<template>
{{ props.reverse }}
</template>this will give the correct type |
0 replies
|
I'm experiencing this as I'm a bit obsessed with the difference between Glad to know I'm not alone, though it does not seem like it ever got much attention. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I don't know if this is an issue with the language tools, or Vue, or even expected, but when
"exactOptionalPropertyTypes": trueis set, optional props still have theundefinedvalue in templates.This is currently an issue for me because some components expect optional props so
(property) reverse?: boolean, which doesn't work withexactOptionalPropertyTypes.Using default props also seems to break:
Should I open an issue for this? (Vue 3.3.8 & Volar/vue-tsc 1.8.22)
All reactions