EditFolder.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <SmartModal v-if="show" @close="$emit('hide-modal')">
  3. <template #header>
  4. <h3 class="heading">{{ $t("folder.edit") }}</h3>
  5. <ButtonSecondary icon="close" @click.native="hideModal" />
  6. </template>
  7. <template #body>
  8. <div class="flex flex-col px-2">
  9. <label for="selectLabelEditFolder" class="font-semibold px-4 pb-4">{{
  10. $t("label")
  11. }}</label>
  12. <input
  13. id="selectLabelEditFolder"
  14. v-model="name"
  15. class="input"
  16. type="text"
  17. @keyup.enter="editFolder"
  18. />
  19. </div>
  20. </template>
  21. <template #footer>
  22. <span>
  23. <ButtonPrimary :label="$t('save')" @click.native="editFolder" />
  24. <ButtonSecondary :label="$t('cancel')" @click.native="hideModal" />
  25. </span>
  26. </template>
  27. </SmartModal>
  28. </template>
  29. <script>
  30. export default {
  31. props: {
  32. show: Boolean,
  33. },
  34. data() {
  35. return {
  36. name: null,
  37. }
  38. },
  39. methods: {
  40. editFolder() {
  41. this.$emit("submit", this.name)
  42. this.hideModal()
  43. },
  44. hideModal() {
  45. this.name = null
  46. this.$emit("hide-modal")
  47. },
  48. },
  49. }
  50. </script>