This repository was archived by the owner on Dec 25, 2024. It is now read-only.
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
If Props'property is not "basic type" ,<withDefaults> will give undefined to them. #62
Closed
Description
example :
<script setup lang="ts">
import { onMounted } from '@vue/composition-api';
type Test = number[];
interface Props{
test: number[];
test2: Test;
}
const props = withDefaults(defineProps<Props>(), {
test:()=>[1, 2, 3],
test2:()=>[1, 2, 3]
});
onMounted(()=>{
console.log(props, 'props'); // => { test: [1,2,3] , test2:undefined }
});
</script>