Calling Component w Vars
2025-01-08
<!-- ChildComponent.vue -->
<script setup>
const props = defineProps(['myVar'])
</script>
<template>
<div>{{ props.myVar }}</div>
</template>
<!-- ParentComponent.vue -->
<script setup>
const myVar = ref('Hello from parent')
</script>
<template>
<ChildComponent :myVar="myVar" />
</template>