Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

feature: Add "disabled" component prop #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/DateDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- Day -->
<div :class="[selectWrapperClassName]">
<select v-model="selectedDay" :class="[selectClassName, selectDayClassName]">
<select v-model="selectedDay" :class="[selectClassName, selectDayClassName]" :disabled="disabled">
<option v-for="day in days" :key="day.day">
{{ day.day }}
</option>
Expand All @@ -12,7 +12,7 @@

<!-- Month -->
<div :class="[selectWrapperClassName]">
<select v-model="selectedMonth" @change="updateDays()" :class="[selectClassName, selectMonthClassName]">
<select v-model="selectedMonth" @change="updateDays()" :class="[selectClassName, selectMonthClassName]" :disabled="disabled">
<option v-for="(month, index) in months" :value="index" :key="month.month">
{{ month.month }}
</option>
Expand All @@ -21,7 +21,7 @@

<!-- Year -->
<div :class="[selectWrapperClassName]">
<select v-model="selectedYear" @change="updateDays()" :class="[selectClassName, selectYearClassName]">
<select v-model="selectedYear" @change="updateDays()" :class="[selectClassName, selectYearClassName]" :disabled="disabled">
<option v-for="year in years" :key="year.year">
{{ year.year }}
</option>
Expand Down Expand Up @@ -96,14 +96,19 @@
required: false,
default: 'date-dropdown-container'
},
disabled: {
type: Boolean,
required: false,
default: false
}
},

data () {
return {
days: [],
selectedDay: '',
selectedMonth: '',
selectedYear: ''
selectedYear: '',
}
},

Expand Down Expand Up @@ -269,4 +274,4 @@
padding: 8px;
margin-right: 10px;
}
</style>
</style>