api-client/components/collections/EditFolder.vue

52 lines
1.1 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>
2021-08-02 15:27:18 +00:00
<h3 class="heading">{{ $t("folder.edit") }}</h3>
2021-08-07 03:37:26 +00:00
<ButtonSecondary icon="close" @click.native="hideModal" />
</template>
<template #body>
2021-07-17 17:40:28 +00:00
<div class="flex flex-col px-2">
<label for="selectLabelEditFolder" class="font-semibold px-4 pb-4">{{
$t("label")
}}</label>
2021-07-09 17:19:45 +00:00
<input
id="selectLabelEditFolder"
v-model="name"
class="input"
type="text"
@keyup.enter="editFolder"
/>
</div>
</template>
<template #footer>
<span>
2021-07-03 13:14:58 +00:00
<ButtonPrimary :label="$t('save')" @click.native="editFolder" />
2021-07-09 17:19:45 +00:00
<ButtonSecondary :label="$t('cancel')" @click.native="hideModal" />
</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>