17e1fcf1
梁灏
init DatePicker
|
1
|
<template>
|
ecaf8d51
梁灏
Date add transfer...
|
2
|
<div :class="[prefixCls]" v-clickoutside="handleClose">
|
531cd165
梁灏
support DatePicke...
|
3
|
<div ref="reference" :class="[prefixCls + '-rel']">
|
e9dd4dab
梁灏
publish 0.9.11-rc-1
|
4
5
|
<slot>
<i-input
|
4863a75d
Sergio Crisostomo
Correct logic whe...
|
6
|
:key="forceInputRerender"
|
acb79ba3
梁灏
fixed #433
|
7
|
:element-id="elementId"
|
e9dd4dab
梁灏
publish 0.9.11-rc-1
|
8
9
10
11
12
13
|
:class="[prefixCls + '-editor']"
:readonly="!editable || readonly"
:disabled="disabled"
:size="size"
:placeholder="placeholder"
:value="visualValue"
|
0460a1e8
梁灏
fixed #812
|
14
|
:name="name"
|
531cd165
梁灏
support DatePicke...
|
15
|
@on-input-change="handleInputChange"
|
e9dd4dab
梁灏
publish 0.9.11-rc-1
|
16
|
@on-focus="handleFocus"
|
030a522d
Sergio Crisostomo
make picker close...
|
17
|
@on-blur="handleBlur"
|
e9dd4dab
梁灏
publish 0.9.11-rc-1
|
18
|
@on-click="handleIconClick"
|
531cd165
梁灏
support DatePicke...
|
19
20
|
@mouseenter.native="handleInputMouseenter"
@mouseleave.native="handleInputMouseleave"
|
e55ba7a2
Sergio Crisostomo
Add week numbers
|
21
22
23
|
:icon="iconType"
></i-input>
|
e9dd4dab
梁灏
publish 0.9.11-rc-1
|
24
25
|
</slot>
</div>
|
531cd165
梁灏
support DatePicke...
|
26
|
<transition :name="transition">
|
ecaf8d51
梁灏
Date add transfer...
|
27
28
29
30
31
32
33
34
|
<Drop
@click.native="handleTransferClick"
v-show="opened"
:class="{ [prefixCls + '-transfer']: transfer }"
:placement="placement"
ref="drop"
:data-transfer="transfer"
v-transfer-dom>
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
35
36
37
38
39
40
41
42
43
44
|
<div>
<component
:is="panel"
:visible="visible"
:showTime="type === 'datetime' || type === 'datetimerange'"
:confirm="isConfirm"
:selectionMode="selectionMode"
:steps="steps"
:format="format"
:value="internalValue"
|
63bd0f7d
Sergio Crisostomo
Add start-date pr...
|
45
|
:start-date="startDate"
|
435bf781
Sergio Crisostomo
add split panel p...
|
46
|
:split-panels="splitPanels"
|
e55ba7a2
Sergio Crisostomo
Add week numbers
|
47
|
:show-week-numbers="showWeekNumbers"
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
48
49
50
51
52
53
54
55
56
57
|
v-bind="ownPickerProps"
@on-pick="onPick"
@on-pick-clear="handleClear"
@on-pick-success="onPickSuccess"
@on-pick-click="disableClickOutSide = true"
@on-selection-mode-change="onSelectionModeChange"
></component>
</div>
|
531cd165
梁灏
support DatePicke...
|
58
59
|
</Drop>
</transition>
|
0f677893
梁灏
update DatePicker
|
60
|
</div>
|
17e1fcf1
梁灏
init DatePicker
|
61
62
|
</template>
<script>
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
63
64
|
|
0f677893
梁灏
update DatePicker
|
65
66
67
|
import iInput from '../../components/input/input.vue';
import Drop from '../../components/select/dropdown.vue';
import clickoutside from '../../directives/clickoutside';
|
ecaf8d51
梁灏
Date add transfer...
|
68
|
import TransferDom from '../../directives/transfer-dom';
|
0f677893
梁灏
update DatePicker
|
69
|
import { oneOf } from '../../utils/assist';
|
af713093
梁灏
update TimePicker
|
70
|
import { formatDate, parseDate } from './util';
|
cd78c9c4
梁灏
some comps suppor...
|
71
|
import Emitter from '../../mixins/emitter';
|
0f677893
梁灏
update DatePicker
|
72
73
74
75
76
77
|
const prefixCls = 'ivu-date-picker';
const DEFAULT_FORMATS = {
date: 'yyyy-MM-dd',
month: 'yyyy-MM',
|
c46f385a
梁灏
update DatePicker
|
78
|
year: 'yyyy',
|
0f677893
梁灏
update DatePicker
|
79
80
81
82
83
84
85
|
datetime: 'yyyy-MM-dd HH:mm:ss',
time: 'HH:mm:ss',
timerange: 'HH:mm:ss',
daterange: 'yyyy-MM-dd',
datetimerange: 'yyyy-MM-dd HH:mm:ss'
};
|
c46f385a
梁灏
update DatePicker
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
const RANGE_SEPARATOR = ' - ';
const DATE_FORMATTER = function(value, format) {
return formatDate(value, format);
};
const DATE_PARSER = function(text, format) {
return parseDate(text, format);
};
const RANGE_FORMATTER = function(value, format) {
if (Array.isArray(value) && value.length === 2) {
const start = value[0];
const end = value[1];
if (start && end) {
return formatDate(start, format) + RANGE_SEPARATOR + formatDate(end, format);
}
}
return '';
};
const RANGE_PARSER = function(text, format) {
const array = text.split(RANGE_SEPARATOR);
if (array.length === 2) {
const range1 = array[0];
const range2 = array[1];
return [parseDate(range1, format), parseDate(range2, format)];
}
return [];
};
const TYPE_VALUE_RESOLVER_MAP = {
default: {
formatter(value) {
if (!value) return '';
return '' + value;
},
parser(text) {
if (text === undefined || text === '') return null;
return text;
}
},
date: {
formatter: DATE_FORMATTER,
parser: DATE_PARSER
},
datetime: {
formatter: DATE_FORMATTER,
parser: DATE_PARSER
},
daterange: {
formatter: RANGE_FORMATTER,
parser: RANGE_PARSER
},
datetimerange: {
formatter: RANGE_FORMATTER,
parser: RANGE_PARSER
},
timerange: {
formatter: RANGE_FORMATTER,
parser: RANGE_PARSER
},
time: {
formatter: DATE_FORMATTER,
parser: DATE_PARSER
},
month: {
formatter: DATE_FORMATTER,
parser: DATE_PARSER
},
year: {
formatter: DATE_FORMATTER,
parser: DATE_PARSER
},
number: {
formatter(value) {
if (!value) return '';
return '' + value;
},
parser(text) {
let result = Number(text);
if (!isNaN(text)) {
return result;
} else {
return null;
}
}
}
};
|
17e1fcf1
梁灏
init DatePicker
|
176
|
export default {
|
21dad188
梁灏
prevent dispatch ...
|
177
|
name: 'CalendarPicker',
|
cd78c9c4
梁灏
some comps suppor...
|
178
|
mixins: [ Emitter ],
|
0f677893
梁灏
update DatePicker
|
179
|
components: { iInput, Drop },
|
ecaf8d51
梁灏
Date add transfer...
|
180
|
directives: { clickoutside, TransferDom },
|
0f677893
梁灏
update DatePicker
|
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
props: {
format: {
type: String
},
readonly: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
editable: {
type: Boolean,
default: true
},
|
fe44201b
梁灏
DatePicker add cl...
|
197
198
199
200
|
clearable: {
type: Boolean,
default: true
},
|
b9041a0d
梁灏
DatePicker add co...
|
201
202
203
204
|
confirm: {
type: Boolean,
default: false
},
|
e9dd4dab
梁灏
publish 0.9.11-rc-1
|
205
206
207
208
|
open: {
type: Boolean,
default: null
},
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
209
210
211
212
|
multiple: {
type: Boolean,
default: false
},
|
435bf781
Sergio Crisostomo
add split panel p...
|
213
214
215
216
|
splitPanels: {
type: Boolean,
default: false
},
|
e55ba7a2
Sergio Crisostomo
Add week numbers
|
217
218
219
220
|
showWeekNumbers: {
type: Boolean,
default: false
},
|
63bd0f7d
Sergio Crisostomo
Add start-date pr...
|
221
222
223
|
startDate: {
type: Date
},
|
0f677893
梁灏
update DatePicker
|
224
225
|
size: {
validator (value) {
|
f00a037c
梁灏
some Components's...
|
226
|
return oneOf(value, ['small', 'large', 'default']);
|
0f677893
梁灏
update DatePicker
|
227
228
229
230
231
232
|
}
},
placeholder: {
type: String,
default: ''
},
|
68e9b100
梁灏
update DatePicker
|
233
|
placement: {
|
0f677893
梁灏
update DatePicker
|
234
|
validator (value) {
|
68e9b100
梁灏
update DatePicker
|
235
|
return oneOf(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
|
0f677893
梁灏
update DatePicker
|
236
|
},
|
68e9b100
梁灏
update DatePicker
|
237
|
default: 'bottom-start'
|
0f677893
梁灏
update DatePicker
|
238
239
240
|
},
options: {
type: Object
|
ecaf8d51
梁灏
Date add transfer...
|
241
242
243
244
|
},
transfer: {
type: Boolean,
default: false
|
0460a1e8
梁灏
fixed #812
|
245
246
247
|
},
name: {
type: String
|
acb79ba3
梁灏
fixed #433
|
248
249
250
|
},
elementId: {
type: String
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
},
steps: {
type: Array,
default: () => []
},
value: {
type: [Date, String, Array],
validator(val){
if (Array.isArray(val)){
const [start, end] = val.map(v => new Date(v));
return !isNaN(start.getTime()) && !isNaN(end.getTime());
} else {
if (typeof val === 'string') val = val.trim();
const date = new Date(val);
return val === '' || val === null || !isNaN(date.getTime());
}
}
|
4863a75d
Sergio Crisostomo
Correct logic whe...
|
268
269
270
271
|
},
options: {
type: Object,
default: () => ({})
|
0f677893
梁灏
update DatePicker
|
272
273
|
}
},
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
274
|
data(){
|
0f677893
梁灏
update DatePicker
|
275
276
277
|
return {
prefixCls: prefixCls,
showClose: false,
|
0f677893
梁灏
update DatePicker
|
278
|
visible: false,
|
8f6aeda4
Sergio Crisostomo
Fix parser and fo...
|
279
|
internalValue: this.parseDate(this.value),
|
531cd165
梁灏
support DatePicke...
|
280
|
disableClickOutSide: false, // fixed when click a date,trigger clickoutside to close picker
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
281
|
disableCloseUnderTransfer: false, // transfer 模式下,点击Drop也会触发关闭,
|
4863a75d
Sergio Crisostomo
Correct logic whe...
|
282
283
|
selectionMode: this.onSelectionModeChange(this.type),
forceInputRerender: 1
|
b0893113
jingsam
add eslint
|
284
|
};
|
0f677893
梁灏
update DatePicker
|
285
286
|
},
computed: {
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
287
|
publicValue(){
|
d07b4f33
Sergio Crisostomo
fix logic for mul...
|
288
|
if (this.multiple){
|
8f6aeda4
Sergio Crisostomo
Fix parser and fo...
|
289
|
return this.internalValue.slice();
|
d07b4f33
Sergio Crisostomo
fix logic for mul...
|
290
291
|
} else {
const isRange = this.type.includes('range');
|
8f6aeda4
Sergio Crisostomo
Fix parser and fo...
|
292
293
|
const val = this.internalValue.map(date => date instanceof Date ? new Date(date) : date);
return (isRange || this.multiple) ? val : val[0];
|
d07b4f33
Sergio Crisostomo
fix logic for mul...
|
294
|
}
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
295
|
},
|
e9dd4dab
梁灏
publish 0.9.11-rc-1
|
296
297
298
|
opened () {
return this.open === null ? this.visible : this.open;
},
|
0f677893
梁灏
update DatePicker
|
299
|
iconType () {
|
9d844d53
梁灏
fixed Layout bug
|
300
|
let icon = 'ios-calendar-outline';
|
456877a1
梁灏
update TimePicker
|
301
|
if (this.type === 'time' || this.type === 'timerange') icon = 'ios-clock-outline';
|
9d844d53
梁灏
fixed Layout bug
|
302
303
|
if (this.showClose) icon = 'ios-close';
return icon;
|
0f677893
梁灏
update DatePicker
|
304
|
},
|
d20fe0ee
梁灏
update DatePicker
|
305
|
transition () {
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
306
307
|
const bottomPlaced = this.placement.match(/^bottom/);
return bottomPlaced ? 'slide-up' : 'slide-down';
|
d20fe0ee
梁灏
update DatePicker
|
308
|
},
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
309
310
|
visualValue() {
const value = this.internalValue;
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
311
|
if (!value) return;
|
d07b4f33
Sergio Crisostomo
fix logic for mul...
|
312
313
|
if (this.multiple) return value.map(date => this.formatDate(date)).join(', ');
|
8f6aeda4
Sergio Crisostomo
Fix parser and fo...
|
314
|
return this.formatDate(value);
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
315
316
|
},
isConfirm(){
|
d07b4f33
Sergio Crisostomo
fix logic for mul...
|
317
|
return this.confirm || this.type === 'datetime' || this.type === 'datetimerange' || this.multiple;
|
0f677893
梁灏
update DatePicker
|
318
319
320
|
}
},
methods: {
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
321
322
323
324
325
326
|
onSelectionModeChange(type){
if (type.match(/^date/)) type = 'date';
this.selectionMode = type;
return type;
},
|
ecaf8d51
梁灏
Date add transfer...
|
327
328
329
330
|
// 开启 transfer 时,点击 Drop 即会关闭,这里不让其关闭
handleTransferClick () {
if (this.transfer) this.disableCloseUnderTransfer = true;
},
|
0f677893
梁灏
update DatePicker
|
331
|
handleClose () {
|
ecaf8d51
梁灏
Date add transfer...
|
332
333
334
335
|
if (this.disableCloseUnderTransfer) {
this.disableCloseUnderTransfer = false;
return false;
}
|
1b7aefea
梁灏
update Picker
|
336
|
if (this.open !== null) return;
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
337
|
|
762c8ddf
梁灏
update DatePicker
|
338
|
this.visible = false;
|
68e9b100
梁灏
update DatePicker
|
339
|
this.disableClickOutSide = false;
|
0f677893
梁灏
update DatePicker
|
340
341
|
},
handleFocus () {
|
e1874103
梁灏
update DatePicker
|
342
|
if (this.readonly) return;
|
0f677893
梁灏
update DatePicker
|
343
344
|
this.visible = true;
},
|
030a522d
Sergio Crisostomo
make picker close...
|
345
346
347
|
handleBlur () {
this.visible = false;
},
|
e1874103
梁灏
update DatePicker
|
348
|
handleInputChange (event) {
|
4863a75d
Sergio Crisostomo
Correct logic whe...
|
349
|
const isArrayValue = this.type.includes('range') || this.multiple;
|
e1874103
梁灏
update DatePicker
|
350
|
const oldValue = this.visualValue;
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
351
|
const newValue = event.target.value;
|
4863a75d
Sergio Crisostomo
Correct logic whe...
|
352
353
354
355
356
357
|
const newDate = this.parseDate(newValue);
const disabledDateFn =
this.options &&
typeof this.options.disabledDate === 'function' &&
this.options.disabledDate;
const valueToTest = isArrayValue ? newDate : newDate[0];
|
e1874103
梁灏
update DatePicker
|
358
|
|
4863a75d
Sergio Crisostomo
Correct logic whe...
|
359
|
if (newValue !== oldValue && !disabledDateFn(valueToTest)) {
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
360
|
this.emitChange();
|
4863a75d
Sergio Crisostomo
Correct logic whe...
|
361
362
363
|
this.internalValue = newDate;
} else {
this.forceInputRerender++;
|
7c5ccdab
梁灏
update DatePicker
|
364
|
}
|
c46f385a
梁灏
update DatePicker
|
365
366
|
},
handleInputMouseenter () {
|
0f677893
梁灏
update DatePicker
|
367
|
if (this.readonly || this.disabled) return;
|
fe44201b
梁灏
DatePicker add cl...
|
368
|
if (this.visualValue && this.clearable) {
|
0f677893
梁灏
update DatePicker
|
369
370
371
|
this.showClose = true;
}
},
|
c46f385a
梁灏
update DatePicker
|
372
|
handleInputMouseleave () {
|
0f677893
梁灏
update DatePicker
|
373
374
375
|
this.showClose = false;
},
handleIconClick () {
|
7b7178f1
梁灏
fixed #528
|
376
377
|
if (this.showClose) {
this.handleClear();
|
f1f0206c
Aresn
fixed Date bug
|
378
|
} else if (!this.disabled) {
|
7b7178f1
梁灏
fixed #528
|
379
380
|
this.handleFocus();
}
|
b9041a0d
梁灏
DatePicker add co...
|
381
382
|
},
handleClear () {
|
c46f385a
梁灏
update DatePicker
|
383
|
this.visible = false;
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
384
|
this.internalValue = this.internalValue.map(() => null);
|
d20fe0ee
梁灏
update DatePicker
|
385
|
this.$emit('on-clear');
|
cd78c9c4
梁灏
some comps suppor...
|
386
|
this.dispatch('FormItem', 'on-form-change', '');
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
387
|
this.emitChange();
|
9d844d53
梁灏
fixed Layout bug
|
388
|
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
389
390
391
392
|
setTimeout(
() => this.onSelectionModeChange(this.type),
500 // delay to improve dropdown close visual effect
);
|
344131a7
梁灏
update DatePicker
|
393
|
},
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
394
395
|
emitChange () {
this.$emit('on-change', this.publicValue);
|
fc0c4c78
梁灏
fixed #494
|
396
|
this.$nextTick(() => {
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
397
|
this.dispatch('FormItem', 'on-form-change', this.publicValue);
|
fc0c4c78
梁灏
fixed #494
|
398
|
});
|
21dad188
梁灏
prevent dispatch ...
|
399
|
},
|
8f6aeda4
Sergio Crisostomo
Fix parser and fo...
|
400
|
parseDate(val) {
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
401
|
const isRange = this.type.includes('range');
|
456877a1
梁灏
update TimePicker
|
402
|
const type = this.type;
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
403
|
const parser = (
|
456877a1
梁灏
update TimePicker
|
404
|
TYPE_VALUE_RESOLVER_MAP[type] ||
|
699a9dc8
梁灏
update DatePicker
|
405
|
TYPE_VALUE_RESOLVER_MAP['default']
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
406
|
).parser;
|
699a9dc8
梁灏
update DatePicker
|
407
|
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
408
409
|
if (val && type === 'time' && !(val instanceof Date)) {
val = parser(val, this.format || DEFAULT_FORMATS[type]);
|
4863a75d
Sergio Crisostomo
Correct logic whe...
|
410
|
} else if (isRange) {
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
411
412
413
414
415
416
|
if (!val){
val = [null, null];
} else {
val = val.map(date => new Date(date)); // try to parse
val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed
}
|
8f6aeda4
Sergio Crisostomo
Fix parser and fo...
|
417
|
} else if (typeof val === 'string' && type.indexOf('time') !== 0){
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
418
419
|
val = parser(val, this.format || DEFAULT_FORMATS[type]) || val;
}
|
4863a75d
Sergio Crisostomo
Correct logic whe...
|
420
|
return (isRange || this.multiple) ? val : [val];
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
421
|
},
|
8f6aeda4
Sergio Crisostomo
Fix parser and fo...
|
422
423
424
425
426
427
428
429
|
formatDate(value){
const {formatter} = (
TYPE_VALUE_RESOLVER_MAP[this.type] ||
TYPE_VALUE_RESOLVER_MAP['default']
);
const format = DEFAULT_FORMATS[this.type];
return formatter(value, this.format || format);
},
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
430
431
|
onPick(dates, visible = false) {
|
d07b4f33
Sergio Crisostomo
fix logic for mul...
|
432
433
434
435
|
if (this.multiple){
const allDates = [...this.internalValue, dates].filter(Boolean);
const timeStamps = allDates.map(date => date.getTime()).filter((ts, i, arr) => arr.indexOf(ts) === i); // filter away duplicates
this.internalValue = timeStamps.map(ts => new Date(ts));
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
436
437
|
} else {
this.internalValue = Array.isArray(dates) ? dates : [dates];
|
0fd13696
梁灏
fixed DatePicker ...
|
438
|
}
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
439
440
441
442
443
444
445
446
|
if (!this.isConfirm) this.onSelectionModeChange(this.type); // reset the selectionMode
if (!this.isConfirm) this.visible = visible;
this.emitChange();
},
onPickSuccess(){
this.visible = false;
this.$emit('on-ok');
|
e55ba7a2
Sergio Crisostomo
Add week numbers
|
447
|
},
|
0f677893
梁灏
update DatePicker
|
448
449
|
},
watch: {
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
450
451
|
visible (state) {
if (state === false){
|
0f677893
梁灏
update DatePicker
|
452
|
this.$refs.drop.destroy();
|
030a522d
Sergio Crisostomo
make picker close...
|
453
454
|
const input = this.$el.querySelector('input');
if (input) input.blur();
|
c46f385a
梁灏
update DatePicker
|
455
|
}
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
456
|
this.$emit('on-open-change', state);
|
c46f385a
梁灏
update DatePicker
|
457
|
},
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
458
|
value(val) {
|
8f6aeda4
Sergio Crisostomo
Fix parser and fo...
|
459
|
this.internalValue = this.parseDate(val);
|
0dd7b94a
梁灏
update TimePicker
|
460
|
|
d20fe0ee
梁灏
update DatePicker
|
461
462
|
},
open (val) {
|
95eae081
Sergio Crisostomo
refactor Datepicker
|
463
464
465
466
|
this.visible = val === true;
},
type(type){
this.onSelectionModeChange(type);
|
8f6aeda4
Sergio Crisostomo
Fix parser and fo...
|
467
468
469
470
471
472
|
},
publicValue(now, before){
const newValue = JSON.stringify(now);
const oldValue = JSON.stringify(before);
if (newValue !== oldValue) this.$emit('input', now); // to update v-model
},
|
e9dd4dab
梁灏
publish 0.9.11-rc-1
|
473
|
},
|
531cd165
梁灏
support DatePicke...
|
474
|
mounted () {
|
d20fe0ee
梁灏
update DatePicker
|
475
|
if (this.open !== null) this.visible = this.open;
|
0f677893
梁灏
update DatePicker
|
476
|
}
|
b0893113
jingsam
add eslint
|
477
478
|
};
</script>
|