api-client/components/collections/EditRequest.vue

58 lines
1.3 KiB
Vue
Raw Normal View History

<template>
<SmartModal v-if="show" @close="hideModal">
<template #header>
<h3 class="heading">{{ $t("edit_request") }}</h3>
<div>
2021-07-03 13:14:58 +00:00
<ButtonSecondary icon="close" @click.native="hideModal" />
2020-12-11 10:29:03 +00:00
</div>
</template>
<template #body>
2021-07-17 17:40:28 +00:00
<div class="flex flex-col px-2">
<label for="selectLabelEditReq" class="font-semibold px-4 pb-4">
2021-07-17 17:40:28 +00:00
{{ $t("label") }}
</label>
2021-07-09 17:19:45 +00:00
<input
id="selectLabelEditReq"
v-model="requestUpdateData.name"
class="input"
type="text"
:placeholder="placeholderReqName"
@keyup.enter="saveRequest"
/>
</div>
</template>
<template #footer>
<span>
2021-07-03 13:14:58 +00:00
<ButtonPrimary :label="$t('save')" @click.native="saveRequest" />
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,
2021-05-18 16:09:55 +00:00
placeholderReqName: { type: String, default: null },
2019-11-02 05:32:21 +00:00
},
data() {
return {
requestUpdateData: {
name: null,
2020-02-24 18:44:50 +00:00
},
}
2019-11-02 05:32:21 +00:00
},
methods: {
saveRequest() {
this.$emit("submit", this.requestUpdateData)
this.hideModal()
2019-11-02 05:32:21 +00:00
},
hideModal() {
this.requestUpdateData = { name: null }
this.$emit("hide-modal")
2020-02-24 18:44:50 +00:00
},
},
}
</script>