mariomka / vue-datetime

Mobile friendly datetime picker for Vue. Supports date and datetime modes, i18n and more.
http://mariomka.github.io/vue-datetime
MIT License
987 stars 246 forks source link

Slot events do not work #133

Open tomchiverton opened 5 years ago

tomchiverton commented 5 years ago

Clicking a slot e.g. icon in input does not open calender

<datetime
    v-model="search_from"
    input-id="from"
    type="date"
    placeholder="From"
>
    <span class="vDateTime-picker__icon" slot="after"></span>
</datetime>
tomchiverton commented 5 years ago

Workaround using global ref and manual event handler :

<datetime
    ref="search_from"
    v-model="search_from"
    input-id="from"
    type="date"
    placeholder="From"
    <span slot="before"
        class="vDateTime-picker__icon" 
        @click="open_calender($event,'search_from')" ></span>
</datetime>
    methods:{
        open_calender:function(event,which){
            this.$refs[which].open(event);
        },