Skip to content

Commit 4c1acbf

Browse files
committed
inline-calendar: Add demo
1 parent ceae5fb commit 4c1acbf

File tree

4 files changed

+48
-7
lines changed

4 files changed

+48
-7
lines changed

src/components/inline-calendar/metas.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ events:
9797
en: emits when value is changed
9898
zh-CN: 值变化时触发
9999
changes:
100+
next:
101+
en:
102+
- '[feature] support multi select #1446 #1467'
103+
zh-CN:
104+
- '[feature] 支持多选 #1446 #1467'
100105
v2.4.0:
101106
en:
102107
- '[enhance] re-render when render-month is changed'
@@ -112,11 +117,6 @@ changes:
112117
- '[change] render-function params day => date #1361'
113118
zh-CN:
114119
- '[change] render-function 参数 day => date(在 3.0 版本前不会影响目前使用)#1361'
115-
v2.3.5:
116-
en:
117-
- '[feature] support multi select #1446 #1467'
118-
zh-CN:
119-
- '[feature] 支持多选 #1446 #1467'
120120
v2.4.0:
121121
en:
122122
- '[enhance] re-render when render-month is changed'

src/demo_list.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,6 @@
107107
"Drawer",
108108
"DatetimeView",
109109
"InlineXNumber",
110-
"PopupHeader"
110+
"PopupHeader",
111+
"InlineCalendarMulti#/demo/inline-calendar-multi"
111112
]

src/demos/InlineCalendarMulti.vue

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<template>
2+
<div>
3+
<inline-calendar v-model="value"></inline-calendar>
4+
<br>
5+
{{ value }}
6+
<div style="padding:15px;">
7+
<x-button type="primary" @click.native="updateValue">update value</x-button>
8+
</div>
9+
</div>
10+
</template>
11+
12+
<script>
13+
import { InlineCalendar, dateFormat, XButton } from 'vux'
14+
15+
const today = dateFormat(new Date(), 'YYYY-MM-DD')
16+
const yesterday = dateFormat(new Date().getTime() - 24 * 3600 * 1000, 'YYYY-MM-DD')
17+
18+
export default {
19+
components: {
20+
InlineCalendar,
21+
XButton
22+
},
23+
data () {
24+
return {
25+
value: [yesterday, today]
26+
}
27+
},
28+
methods: {
29+
updateValue () {
30+
if (this.value.length === 1) {
31+
this.value = [yesterday, today]
32+
} else {
33+
this.value = [today]
34+
}
35+
}
36+
}
37+
}
38+
</script>

src/theme.less

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@
2828

2929
@search-cancel-font-color: #FF9900;
3030

31-
@radio-checked-icon-color: #FF9900;
31+
@radio-checked-icon-color: #FF9900;
32+
33+
@calendar-arrow-color: #c0c0c0;

0 commit comments

Comments
 (0)