Syntax
// Using script setup
<script setup>
const props = defineProps(['data1', 'data2', ...]);
</script>
// Using non script setup
<script>
export default{
props: [ 'data1', 'data2'... ]
}
Vue.js Props
Vue.js Props is an attribute to the configuration of the component. It is used to pass the data to the component to work dynamically. The props configuration defines the type of data it can receive from different components of Vue.
Table of Content
- Props Declaration
- Prop Passing Details
- One-Way Data Flow
- Prop Validation
- Boolean Casting