vue-datetime icon indicating copy to clipboard operation
vue-datetime copied to clipboard

QUESTION - Show modal with hidden input field

Open radud opened this issue 5 years ago • 2 comments

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

radud avatar Oct 18 '20 09:10 radud

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.

mofolo avatar Nov 15 '20 11:11 mofolo

https://github.com/tripflex/vue-datetime my fork adds an argument to not use the input

tripflex avatar Aug 27 '21 21:08 tripflex