Card.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!--
  2. Container de type Card
  3. -->
  4. <template>
  5. <v-card
  6. elevation="2"
  7. outlined
  8. shaped
  9. min-height="200"
  10. >
  11. <v-card-title>
  12. <slot name="card.title" />
  13. </v-card-title>
  14. <v-card-text>
  15. <slot name="card.text" />
  16. </v-card-text>
  17. <v-card-actions>
  18. <v-spacer />
  19. <v-btn icon>
  20. <NuxtLink :to="link" class="no-decoration">
  21. <v-icon>mdi-pencil</v-icon>
  22. </NuxtLink>
  23. </v-btn>
  24. <UiButtonDelete :delete-args="args" />
  25. <slot name="card.action" />
  26. </v-card-actions>
  27. </v-card>
  28. </template>
  29. <script lang="ts">
  30. import { defineComponent } from '@nuxtjs/composition-api'
  31. import { QUERY_TYPE } from '~/types/enums'
  32. import { DataDeleterArgs } from '~/types/interfaces'
  33. export default defineComponent({
  34. props: {
  35. link: {
  36. type: String,
  37. required: true
  38. },
  39. model: {
  40. type: Function,
  41. required: true
  42. },
  43. id: {
  44. type: Number,
  45. required: true
  46. }
  47. },
  48. setup (props) {
  49. const args: DataDeleterArgs = {
  50. type: QUERY_TYPE.MODEL,
  51. model: props.model,
  52. id: props.id
  53. }
  54. return {
  55. args
  56. }
  57. }
  58. })
  59. </script>
  60. <style scoped>
  61. </style>