I looked into this vuejs-datepicker to add datepicker to my project.
<div class="startDate">
<datepicker
v-model="startDate"
format="YYYY-MM-DD"
name="startDate"
></datepicker>
</div>
import datepicker from "vue-date-picker";
<style scoped>
.startDate {
width: 150px;
}
<style>
But still width of startDate shows 238px which is default width of datepicker.
try this
<div>
<datepicker class="startDate"
v-model="startDate"
:readonly="true"
format="YYYY-MM-DD"
name="startDate"
></datepicker>
</div>
.startDate {
width: 150px;
}
First of all remove scoped from style portion. And obtain classname by inspecting datepicker element.
Here, in my case classname for startDate is .datetime-picker input[data-v-a46a390c]
Now, apply to css like this:
.datetime-picker input[data-v-a46a390c] {
width: 150px;
height: 38px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With