nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.32k stars 840 forks source link

is it possible to custom attribute on input element #1369

Open shinnlu opened 10 months ago

shinnlu commented 10 months ago

the date-picker was generate html <input data-v-3ca7c91d="" readonly="readonly" class="form-control"> how to add id attribute to it?

shinnlu commented 10 months ago

i have found the answer to use custom template

<date-picker v-model="BirthDate">
    <template v-slot="{ inputValue, inputEvents }">
        <input id="BirthDate" :value="inputValue" v-on="inputEvents" readonly=""/>
        <span v-show="isDateEmpty(inputValue)" class="remove" @click.stop="BirthDate=''">x</span>
    </template>
</date-picker>