Skip to content

Commit

Permalink
inline-calendar: Add demo
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Jul 30, 2017
1 parent ceae5fb commit 4c1acbf
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/components/inline-calendar/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ events:
en: emits when value is changed
zh-CN: 值变化时触发
changes:
next:
en:
- '[feature] support multi select #1446 #1467'
zh-CN:
- '[feature] 支持多选 #1446 #1467'
v2.4.0:
en:
- '[enhance] re-render when render-month is changed'
Expand All @@ -112,11 +117,6 @@ changes:
- '[change] render-function params day => date #1361'
zh-CN:
- '[change] render-function 参数 day => date(在 3.0 版本前不会影响目前使用)#1361'
v2.3.5:
en:
- '[feature] support multi select #1446 #1467'
zh-CN:
- '[feature] 支持多选 #1446 #1467'
v2.4.0:
en:
- '[enhance] re-render when render-month is changed'
Expand Down
3 changes: 2 additions & 1 deletion src/demo_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,6 @@
"Drawer",
"DatetimeView",
"InlineXNumber",
"PopupHeader"
"PopupHeader",
"InlineCalendarMulti#/demo/inline-calendar-multi"
]
38 changes: 38 additions & 0 deletions src/demos/InlineCalendarMulti.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<div>
<inline-calendar v-model="value"></inline-calendar>
<br>
{{ value }}
<div style="padding:15px;">
<x-button type="primary" @click.native="updateValue">update value</x-button>
</div>
</div>
</template>

<script>
import { InlineCalendar, dateFormat, XButton } from 'vux'
const today = dateFormat(new Date(), 'YYYY-MM-DD')
const yesterday = dateFormat(new Date().getTime() - 24 * 3600 * 1000, 'YYYY-MM-DD')
export default {
components: {
InlineCalendar,
XButton
},
data () {
return {
value: [yesterday, today]
}
},
methods: {
updateValue () {
if (this.value.length === 1) {
this.value = [yesterday, today]
} else {
this.value = [today]
}
}
}
}
</script>
4 changes: 3 additions & 1 deletion src/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@

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

@radio-checked-icon-color: #FF9900;
@radio-checked-icon-color: #FF9900;

@calendar-arrow-color: #c0c0c0;

0 comments on commit 4c1acbf

Please sign in to comment.