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
879 B

5 years ago
5 years ago
5 years ago
  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') mdi-alert
  6. span {{$t('editor:unsaved.title')}}
  7. v-card-text.pt-4
  8. .body-2 {{$t('editor:unsaved.body')}}
  9. v-card-chin
  10. v-spacer
  11. v-btn(text, @click='isShown = false') {{$t('common:actions.cancel')}}
  12. v-btn.px-4(color='red', @click='discard', dark) {{$t('common:actions.discardChanges')}}
  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>