Reactive Props Destructure: the default value is not render in page.
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
Comp.vue
<script setup lang="ts">
const { name = 'default name' } = defineProps<{
name?: string
}>()
console.log(`Name: ${ name };`)
</script>
<template>
<div>Name: {{ name }} ;</div>
</template>
App.vue
<Comp name="jeffrey" />
<Comp />
the default value is not render in page, but console output the default value.
What is expected?
the page render:
Name: jeffrey;
Name: default name;
the console output:
Name: jeffrey;
Name: default name;
What is actually happening?
the page render:
Name: jeffrey;
Name: ;
the console output:
Name: jeffrey;
Name: default name;
System Info
No response
Any additional comments?
No response
See https://github.com/vuejs/rfcs/discussions/502 and enable propsDestructure
feature.