Card is not showing anything

UI Components for Vue
Post Reply
jeroendeb
Posts: 1
Joined: 06 Nov 2020, 21:48

06 Nov 2020, 21:59

When I use a card, nothing is showing. Also when I inspect the card the content is not visible. There's no errors. I use Vue 3.

Code: Select all

<template>
  <Card>
    content
  </Card>
</template>

<script>

import {defineComponent, ref} from "vue";
import Card from 'primevue/card';

export default defineComponent({

  components: {
    Card
  }

});

</script>

<style lang="scss" scoped>

</style>
And this is what I find in the inspector:

Code: Select all

<div class="p-card p-component" data-v-f2d0900a="" bis_skin_checked="1"><!--v-if--><div class="p-card-body" bis_skin_checked="1"><!--v-if--><!--v-if--><div class="p-card-content" bis_skin_checked="1"></div><!--v-if--></div></div>

mert.sincan
Posts: 4484
Joined: 29 Jun 2013, 12:38

12 Nov 2020, 10:29

Hi,

Thanks a lot for the code block, please use <template> tag to activate slots in Card components. Note: Card doesn't have a default slot.

Code: Select all

<Card>
   <template v-slot:content>
         Content
   </template>
</Card>
Best Regards,

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest