When reviewing the code below, Vetur concluded that x,y
are of type number | undefined
.
The presence of undefined
is leading to numerous warnings when using x,y
further in the code.
Is there a way to eliminate the undefined
from the type inference?
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
props: { x: Number, y: Number },
setup(props) {
let { x, y } = props
},
})
</script>