[[defineProps (Vue)|defineProps]]を使う。 ```js const props = defineProps({ foo: String }) ``` [[TypeScript]]の場合は[型定義を使って書ける](https://v3.vuejs.org/api/sfc-script-setup.html#typescript-only-features)。 ```ts const props = defineProps<{ foo: string bar?: number }>() ``` [[Vue 3.5]]からは[[Reactive Props Destructure (Vue)|Reactive Props Destructure]]が使えるようになったため、以下のように書ける。 ```ts const { foo } = defineProps({ foo: String }) ``` ## MOC - 📒**関連** - [[propsのデフォルト(default)値を定義 (script setup)|propsのデフォルト(default)値を定義]] - 📜**アクティビティ** - 📝**トラブルシューティング**