Cristiano Magro
2025-01-05 30949bb4a4b22fef5119f04c3e3276c42aaab085
named slot
3 files modified
16 ■■■■ changed files
09 - deeper into components/cmp-adv-01-starting-setup/src/components/BadgeList.vue 6 ●●●● patch | view | raw | blame | history
09 - deeper into components/cmp-adv-01-starting-setup/src/components/BaseCard.vue 3 ●●●●● patch | view | raw | blame | history
09 - deeper into components/cmp-adv-01-starting-setup/src/components/UserInfo.vue 7 ●●●●● patch | view | raw | blame | history
09 - deeper into components/cmp-adv-01-starting-setup/src/components/BadgeList.vue
@@ -1,7 +1,10 @@
<template>
  <section>
  <base-card>
      <template v-slot:header>
    <h2>Available Badges</h2>
      </template>
      <template v-slot:default>
    <ul>
      <li>
        <base-badge type="admin" caption="ADMIN"></base-badge>
@@ -10,16 +13,17 @@
        <base-badge type="author" caption="AUTHOR"></base-badge>
      </li>
    </ul>
      </template>
  </base-card>
  </section>
</template>
<style scoped>
section h2 {
  margin: 0.5rem 0;
  color: #3a3a3a;
}
ul {
  list-style: none;
  margin: 0;
09 - deeper into components/cmp-adv-01-starting-setup/src/components/BaseCard.vue
@@ -1,5 +1,8 @@
<template>
    <div>
        <header>
            <slot name="header"></slot>
        </header>
        <slot></slot>
    </div>
</template>
09 - deeper into components/cmp-adv-01-starting-setup/src/components/UserInfo.vue
@@ -1,11 +1,13 @@
<template>
  <section>
    <base-card>
      <header>
      <template v-slot:header>
        <h3>{{ fullName }}</h3>
        <base-badge :type="role" :caption="role.toUpperCase()"></base-badge>
      </header>
      </template>
      <template v-slot:default>
      <p>{{ infoText }}</p>
      </template>
    </base-card>
  </section>
</template>
@@ -17,7 +19,6 @@
</script>
<style scoped>
section header {
  display: flex;
  justify-content: space-between;