Cristiano Magro
2025-01-05 394e8ddcebc1c1affa7f23bf51ae927ed07125ea
introducing slot
1 files added
2 files modified
32 ■■■■ changed files
09 - deeper into components/cmp-adv-01-starting-setup/src/components/BaseCard.vue 21 ●●●●● patch | view | raw | blame | history
09 - deeper into components/cmp-adv-01-starting-setup/src/components/UserInfo.vue 9 ●●●● patch | view | raw | blame | history
09 - deeper into components/cmp-adv-01-starting-setup/src/main.js 2 ●●●●● patch | view | raw | blame | history
09 - deeper into components/cmp-adv-01-starting-setup/src/components/BaseCard.vue
New file
@@ -0,0 +1,21 @@
<template>
    <div>
        <slot></slot>
    </div>
</template>
<script>
export default {
}
</script>
<style scoped>
div {
  margin: 2rem auto;
  max-width: 30rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
  padding: 1rem;
}
</style>
09 - deeper into components/cmp-adv-01-starting-setup/src/components/UserInfo.vue
@@ -1,10 +1,12 @@
<template>
  <section>
    <base-card>
    <header>
      <h3>{{ fullName }}</h3>
      <base-badge :type="role" :caption="role.toUpperCase()"></base-badge>
    </header>
    <p>{{ infoText }}</p>
    </base-card>
  </section>
</template>
@@ -15,13 +17,6 @@
</script>
<style scoped>
section {
  margin: 2rem auto;
  max-width: 30rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.26);
  padding: 1rem;
}
section header {
  display: flex;
09 - deeper into components/cmp-adv-01-starting-setup/src/main.js
@@ -2,10 +2,12 @@
import App from './App.vue';
import BaseBadge from './components/BaseBadge.vue';
import BaseCard from './components/BaseCard.vue';
const app = createApp(App);
app.component('base-badge', BaseBadge);
app.component('base-card', BaseCard);
app.mount('#app');