research_ui/components/research/components/FormAddToTree.vue
2025-02-04 16:10:58 +03:30

75 lines
1.4 KiB
Vue

<template>
<form
class="container"
role="create"
style="height: 100%; display: flex; flex-direction: column"
>
<div class="form-group">
<label>نام را وارد کنید :</label>
<input
type="text"
class="form-control"
placeholder="شروع به نوشتن کنید"
v-model="nameInput"
/>
</div>
<div class="form-row d-flex justify-content-end">
<div class="form-group">
<button
@click.prevent="close()"
type="button"
class="btn btn-default"
data-dismiss="modal"
>
بستن
</button>
<button
@click.prevent="save()"
type="button"
class="btn btn-outline-primary me-2"
>
ذخیره
</button>
<!-- <button
:disabled="fetchingData"
@click.prevent="remove()"
type="button"
class="btn btn-primary"
>
حذف
</button> -->
</div>
</div>
</form>
</template>
<script>
export default {
props: {
value: {
default: "",
},
},
mounted() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
data() {
return {
nameInput: "",
};
},
methods: {
close() {
this.$emit("closeAddName");
},
save() {
this.$emit("addNew", this.nameInput);
this.$emit("close");
},
},
};
</script>