Commit ac231c9ab497b034de5d90c063353a74872eeead
1 parent
435bf781
examples
Showing
1 changed file
with
10 additions
and
1 deletions
Show diff stats
examples/routers/date.vue
... | ... | @@ -167,12 +167,17 @@ |
167 | 167 | <br> |
168 | 168 | <Date-picker type="date" format="yyyy-MM-dd HH:mm" placeholder="选择日期和时间(不含秒)" style="width: 200px"></Date-picker> | Single date, format MM-dd HH:mm |
169 | 169 | <br> |
170 | + <Date-picker type="datetime" :start-date="minDate" v-model="singleDate" placeholder="选择日期和时间" style="width: 200px"></Date-picker> | Single datetime, date object, start date | |
171 | + <br> | |
172 | + | |
170 | 173 | </div> |
171 | 174 | <div style="width: 50%; float: right;"> |
172 | 175 | <Date-picker type="datetimerange" :value="dateRange" placeholder="选择日期和时间" style="width: 300px"></Date-picker> | DateTimeRange, date objects |
173 | 176 | <br> |
174 | 177 | <Date-picker type="daterange" placeholder="选择日期和时间" style="width: 300px"></Date-picker> | Range, no dates |
175 | 178 | <br> |
179 | + <Date-picker type="daterange" split-panels placeholder="选择日期和时间" style="width: 300px"></Date-picker> | Range, no dates, split panels | |
180 | + <br> | |
176 | 181 | <Date-picker type="datetimerange" format="yyyy-MM-dd HH:mm" placeholder="选择日期和时间(不含秒)" style="width: 300px"></Date-picker> | DateTimeRange, format yyyy-MM-dd HH:mm |
177 | 182 | </div> |
178 | 183 | <div style="width: 50%; float: right;"> |
... | ... | @@ -183,10 +188,14 @@ |
183 | 188 | <script> |
184 | 189 | export default { |
185 | 190 | data(){ |
191 | + const now = new Date().getTime(); | |
192 | + const oneMonth = 2592e6; | |
186 | 193 | return { |
187 | 194 | dateString: '2018-01-03 20:52:59', |
188 | 195 | singleDate: new Date(1978, 4, 10), |
189 | - dateRange: [new Date(2010, 0, 1), new Date()] | |
196 | + dateRange: [new Date(2010, 4, 1), new Date()], | |
197 | + minDate: new Date(2010, 4, 1), | |
198 | + maxDate: new Date(now + oneMonth) | |
190 | 199 | } |
191 | 200 | } |
192 | 201 | } | ... | ... |