Card.vue 1.1 KB

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