You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.2 KiB

4 years ago
4 years ago
  1. <template>
  2. <v-card>
  3. <v-toolbar
  4. color="primary white--text"
  5. flat
  6. >
  7. <v-toolbar-title>{{ title }}</v-toolbar-title>
  8. </v-toolbar>
  9. <v-card-text class="text--primary mt-3 pl-4">
  10. <slot name="content" />
  11. </v-card-text>
  12. <v-card-actions>
  13. <v-spacer />
  14. <v-btn
  15. v-if="cancelText"
  16. class="text-capitalize"
  17. text
  18. color="primary"
  19. data-test="cancel-button"
  20. @click="cancel"
  21. >
  22. {{ cancelText }}
  23. </v-btn>
  24. <v-btn
  25. v-if="agreeText"
  26. :disabled="disabled"
  27. class="text-none"
  28. text
  29. data-test="delete-button"
  30. @click="agree"
  31. >
  32. {{ agreeText }}
  33. </v-btn>
  34. </v-card-actions>
  35. </v-card>
  36. </template>
  37. <script lang="ts">
  38. import Vue from 'vue'
  39. export default Vue.extend({
  40. props: {
  41. title: {
  42. type: String,
  43. default: '',
  44. required: true
  45. },
  46. cancelText: {
  47. type: String,
  48. default: ''
  49. },
  50. agreeText: {
  51. type: String,
  52. default: ''
  53. },
  54. disabled: {
  55. type: Boolean,
  56. default: false
  57. }
  58. },
  59. methods: {
  60. agree() {
  61. this.$emit('agree')
  62. },
  63. cancel() {
  64. this.$emit('cancel')
  65. }
  66. }
  67. })
  68. </script>