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.

64 lines
997 B

4 years ago
  1. <template>
  2. <v-dialog
  3. v-model="dialog"
  4. width="800px"
  5. >
  6. <template v-slot:activator="{}">
  7. <v-btn
  8. :class="classObject"
  9. :color="color"
  10. :outlined="isOutlined"
  11. :disabled="disabled"
  12. class="mb-2 text-capitalize"
  13. @click="dialog=true"
  14. >
  15. {{ text }}
  16. </v-btn>
  17. </template>
  18. <slot :close="close" />
  19. </v-dialog>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. text: {
  25. type: String,
  26. default: '',
  27. required: true
  28. },
  29. disabled: {
  30. type: Boolean,
  31. default: false
  32. },
  33. isCreate: {
  34. type: Boolean,
  35. default: false
  36. }
  37. },
  38. data() {
  39. return {
  40. dialog: false
  41. }
  42. },
  43. computed: {
  44. classObject() {
  45. return this.isCreate ? [] : ['ml-2']
  46. },
  47. color() {
  48. return this.isCreate ? 'primary' : ''
  49. },
  50. isOutlined() {
  51. return !this.isCreate
  52. }
  53. },
  54. methods: {
  55. close() {
  56. this.dialog = false
  57. }
  58. }
  59. }
  60. </script>