I am initializing Vue js modal after a user clicks on edit.
This is the modal element:
<modal name="edit-time">
<div class="row col"">
<div class="time">
<div class="form-row mb-3">
<div class="col-4">
<label for="time">Time</label>
</div>
<div class="col-8">
<input type="time" v-model="time" id="time" class="form-control">
</div>
</div>
</div>
</div>
</modal>
And here is where I open the modal
<button @click="showEditModal()" type="button">Edit</button>
And here is the JS part
<script>
export default {
name: 'demo',
components: {
},
data () {
},
created () {
},
computed: {
},
methods: {
showEditModal () {
time = "15:15";
this.$modal.show('edit-time', { time: time });
},
hideModal () {
this.$modal.hide('edit-time');
}
},
}
</script>
What I am trying to do it to pass variable time to a modal.
Can anyone suggest how can I pass the variable to a modal?