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,7 +6,7 @@ | ||
| 6 | <div :class="[prefixCls + '-header']"> | 6 | <div :class="[prefixCls + '-header']"> |
| 7 | <span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span> | 7 | <span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span> |
| 8 | </div> | 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 | </div> | 10 | </div> |
| 11 | </template> | 11 | </template> |
| 12 | <script> | 12 | <script> |
| @@ -44,7 +44,8 @@ | @@ -44,7 +44,8 @@ | ||
| 44 | }, | 44 | }, |
| 45 | data () { | 45 | data () { |
| 46 | return { | 46 | return { |
| 47 | - prefixCls: prefixCls | 47 | + prefixCls: prefixCls, |
| 48 | + readCells: [] | ||
| 48 | } | 49 | } |
| 49 | }, | 50 | }, |
| 50 | watch: { | 51 | watch: { |
| @@ -72,6 +73,9 @@ | @@ -72,6 +73,9 @@ | ||
| 72 | maxDate: this.maxDate | 73 | maxDate: this.maxDate |
| 73 | }); | 74 | }); |
| 74 | } | 75 | } |
| 76 | + }, | ||
| 77 | + cells (cells) { | ||
| 78 | + this.readCells = cells; | ||
| 75 | } | 79 | } |
| 76 | }, | 80 | }, |
| 77 | computed: { | 81 | computed: { |
test/routers/date.vue
| 1 | <template> | 1 | <template> |
| 2 | <div style="margin: 50px"> | 2 | <div style="margin: 50px"> |
| 3 | + <i-button @click="setDate">change date</i-button> | ||
| 3 | <br> | 4 | <br> |
| 4 | <row> | 5 | <row> |
| 5 | <i-col span="8"> | 6 | <i-col span="8"> |
| @@ -122,7 +123,8 @@ | @@ -122,7 +123,8 @@ | ||
| 122 | // console.log(s) | 123 | // console.log(s) |
| 123 | }, | 124 | }, |
| 124 | setDate () { | 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 | } |