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 7ca6abd
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 18 deletions.
17 changes: 1 addition & 16 deletions src/components/inline-calendar/metas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,7 @@ events:
en: emits when value is changed
zh-CN: 值变化时触发
changes:
v2.4.0:
en:
- '[enhance] re-render when render-month is changed'
zh-CN:
- '[enhance] 当 render-month 变化时重新渲染日历'
v2.3.8:
en:
- '[enhance] prevent from clicking invisiable date #1564'
zh-CN:
- '[enhance] 不可见日期不可点击 #1564'
v2.3.6:
en:
- '[change] render-function params day => date #1361'
zh-CN:
- '[change] render-function 参数 day => date(在 3.0 版本前不会影响目前使用)#1361'
v2.3.5:
next:
en:
- '[feature] support multi select #1446 #1467'
zh-CN:
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 7ca6abd

Please sign in to comment.