Cristiano Magro
2025-01-05 bae1330af41d5475709da06fdb3f03ff199635b6
scoped slot
1 files added
1 files modified
28 ■■■■■ changed files
09 - deeper into components/cmp-adv-01-starting-setup/src/App.vue 11 ●●●●● patch | view | raw | blame | history
09 - deeper into components/cmp-adv-01-starting-setup/src/components/CourseGoals.vue 17 ●●●●● patch | view | raw | blame | history
09 - deeper into components/cmp-adv-01-starting-setup/src/App.vue
@@ -7,6 +7,13 @@
      :info-text="activeUser.description"
      :role="activeUser.role"
    ></user-info>
    <course-goals>
      <template #default="slotProps">
        <h2>{{ slotProps.item }}</h2>
        <p>{{ slotProps['anotherProp'] }}</p>
        <p>{{ slotProps.ciccio }}</p>
      </template>
    </course-goals>
  </div>
</template>
@@ -14,6 +21,7 @@
import TheHeader from './components/TheHeader.vue';
import BadgeList from './components/BadgeList.vue';
import UserInfo from './components/UserInfo.vue';
import CourseGoals from './components/CourseGoals.vue';
export default {
  components: {
@@ -21,7 +29,8 @@
    // TheHeader: TheHeader,
    TheHeader,
    BadgeList,
    UserInfo
    UserInfo,
    CourseGoals,
  },
  data() {
    return {
09 - deeper into components/cmp-adv-01-starting-setup/src/components/CourseGoals.vue
New file
@@ -0,0 +1,17 @@
<template>
    <ul>
        <li v-for="goal in goals" :key="goal">
           <slot :item="goal" another-prop="qualcosa" ciccio="ciccio"></slot>
        </li>
    </ul>
</template>
<script>
export default {
    data() {
        return {
            goals: ['Finish the course', 'Learn Vue'],
        }
    }
}
</script>