webfansplz / vuejs-challenges

Collection of Vue.js challenges
https://vuejs-challenges.netlify.app/
MIT License
2.7k stars 188 forks source link

9 - Dependency Injection #2694

Open LauGM opened 4 months ago

LauGM commented 4 months ago
<script setup lang="ts">
import { inject} from "vue"
// Add a piece of code to make the `count` value get injected into the child component.
let count = inject('count');
</script>

<template>
  {{ count }}
</template>