api-client/components/collections/EditFolder.vue

57 lines
1.2 KiB
Vue
Raw Normal View History

<template>
2021-05-18 16:09:55 +00:00
<SmartModal v-if="show" @close="$emit('hide-modal')">
<template #header>
<h3 class="heading">{{ $t("edit_folder") }}</h3>
<div>
<button class="icon button" @click="hideModal">
<i class="material-icons">close</i>
</button>
2020-12-11 10:29:03 +00:00
</div>
</template>
<template #body>
2021-07-01 10:10:51 +00:00
<label for="selectLabelEditFolder">{{ $t("label") }}</label>
2021-05-18 16:09:55 +00:00
<input
2021-07-01 10:10:51 +00:00
id="selectLabelEditFolder"
2021-05-18 16:09:55 +00:00
v-model="name"
class="input"
2021-05-18 16:09:55 +00:00
type="text"
@keyup.enter="editFolder"
/>
</template>
<template #footer>
<span></span>
<span>
<button class="icon button" @click="hideModal">
{{ $t("cancel") }}
</button>
<button class="icon button primary" @click="editFolder">
{{ $t("save") }}
</button>
</span>
</template>
</SmartModal>
</template>
<script>
2019-11-02 05:32:21 +00:00
export default {
props: {
show: Boolean,
},
data() {
return {
name: null,
2020-02-24 18:44:50 +00:00
}
2019-11-02 05:32:21 +00:00
},
methods: {
editFolder() {
this.$emit("submit", this.name)
this.hideModal()
},
2019-11-02 05:32:21 +00:00
hideModal() {
this.name = null
this.$emit("hide-modal")
2020-02-24 18:44:50 +00:00
},
},
}
</script>