Props
<script setup>
const props = defineProps(['foo']);
console.log(props.foo);
</script>
<script>
export default {
props: ['foo'],
setup(props) {
console.log(props.foo);
}
};
</script>Prop Passing Details
Prop Name Casing
defineProps({
greetingMessage: String
})Static vs. Dynamic Props
Passing Different Value Types
One-Way Data Flow
Mutating Object / Array Props
Prop Validation
Last updated