Commit fa3a666da1efd41d0c4ac8481f2ed9d1b053eb7c
1 parent
07f400e5
update DatePicker
update DatePicker
Showing
2 changed files
with
9 additions
and
3 deletions
Show diff stats
src/components/date-picker/base/date-table.vue
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <div :class="[prefixCls + '-header']"> |
| 7 | 7 | <span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span> |
| 8 | 8 | </div> |
| 9 | - <span :class="getCellCls(cell)" v-for="cell in cells"><em :index="$index">{{ cell.text }}</em></span> | |
| 9 | + <span :class="getCellCls(cell)" v-for="cell in readCells"><em :index="$index">{{ cell.text }}</em></span> | |
| 10 | 10 | </div> |
| 11 | 11 | </template> |
| 12 | 12 | <script> |
| ... | ... | @@ -44,7 +44,8 @@ |
| 44 | 44 | }, |
| 45 | 45 | data () { |
| 46 | 46 | return { |
| 47 | - prefixCls: prefixCls | |
| 47 | + prefixCls: prefixCls, | |
| 48 | + readCells: [] | |
| 48 | 49 | } |
| 49 | 50 | }, |
| 50 | 51 | watch: { |
| ... | ... | @@ -72,6 +73,9 @@ |
| 72 | 73 | maxDate: this.maxDate |
| 73 | 74 | }); |
| 74 | 75 | } |
| 76 | + }, | |
| 77 | + cells (cells) { | |
| 78 | + this.readCells = cells; | |
| 75 | 79 | } |
| 76 | 80 | }, |
| 77 | 81 | computed: { | ... | ... |
test/routers/date.vue
| 1 | 1 | <template> |
| 2 | 2 | <div style="margin: 50px"> |
| 3 | + <i-button @click="setDate">change date</i-button> | |
| 3 | 4 | <br> |
| 4 | 5 | <row> |
| 5 | 6 | <i-col span="8"> |
| ... | ... | @@ -122,7 +123,8 @@ |
| 122 | 123 | // console.log(s) |
| 123 | 124 | }, |
| 124 | 125 | setDate () { |
| 125 | - this.value = '2016-12-24' | |
| 126 | +// this.value = '2016-12-24' | |
| 127 | +// this.value2 = ['2016-9-1', '2016-9-20'] | |
| 126 | 128 | } |
| 127 | 129 | } |
| 128 | 130 | } | ... | ... |