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.

40 lines
910 B

  1. <template lang="pug">
  2. v-dialog(v-model='isShown', max-width='550')
  3. v-card.wiki-form
  4. .dialog-header.is-short.is-red
  5. v-icon.mr-2(color='white') warning
  6. span Discard Unsaved Changes?
  7. v-card-text
  8. .body-2 You have unsaved changes. Are you sure you want to leave the editor and discard any modifications you made since the last save?
  9. v-card-chin
  10. v-spacer
  11. v-btn(flat, @click='isShown = false') Cancel
  12. v-btn(color='red', @click='discard', dark) Discard Changes
  13. </template>
  14. <script>
  15. export default {
  16. props: {
  17. value: {
  18. type: Boolean,
  19. default: false
  20. }
  21. },
  22. data() {
  23. return { }
  24. },
  25. computed: {
  26. isShown: {
  27. get() { return this.value },
  28. set(val) { this.$emit('input', val) }
  29. }
  30. },
  31. methods: {
  32. async discard() {
  33. this.isShown = false
  34. this.$emit('discard', true)
  35. }
  36. }
  37. }
  38. </script>