[Vuejs]-How to make a reactive copy from props with Vue3/TypeScript?

0👍

check this link
https://vuejs.org/guide/typescript/composition-api.html#props-default-values


    <script setup lang="ts">
    interface Props {
      foo: string
      bar?: number
    }
    
    // reactive destructure for defineProps()
    // default value is compiled to equivalent runtime option
    const { foo, bar = 100 } = defineProps<Props>()
    </script>

Leave a comment