I am developing task manager app and ı have a problem. I want to edit existing task but when i use v-model my task editing withoute save button. I dont want this. I want to edit with save button and make api call after click save buttton to save database.
How can i do this? Can i use assigne props to new variable or do you have any idea?
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">{{task.name}}</h5>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="taskNameInput">Task Name</label>
<input
type="text"
placeholder="Please enter new task name"
class="form-control"
id="taskNameInput"
maxlength="25"
v-model="task.name"
/>
<div class="modal-footer">
<button
type="button"
style="width: 100%"
class="btn btn-success"
>
Save Task
</button>
<button
type="button"
style="width: 100%"
class="btn btn-success"
>
Delete Task
</button>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "UpdateModal",
props: ["task"],
methods: {
updateTask(){
}
}