vue-datetime
vue-datetime copied to clipboard
QUESTION - Show modal with hidden input field
Description:
Hi there, Thank you for this awesome component!
This is not an issue. Is a question.
Is there a way to use a hidden input and show picker using event?
Many thanks, Radu
Hey Radud,
I managed to do this using Vue's ref.
You can do something like this
HTML
<datetime v-model="pageDateString"
input-class="d-none"
type="date"
:max-datetime="maxDate"
ref="dateSelector"></datetime>
<a class="page-link" @click="dateSelector">Button</a>
JS
dateSelector()
{
this.$refs.dateSelector.isOpen = true
}
The .class d-none is bootstrap 4 which applies: display:none to the input.
https://github.com/tripflex/vue-datetime my fork adds an argument to not use the input