Skip to content

Commit

Permalink
234
Browse files Browse the repository at this point in the history
  • Loading branch information
ydcss committed Apr 12, 2018
1 parent 205bda7 commit 996fa68
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 60 deletions.
6 changes: 4 additions & 2 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#### 问题描述

(作者是个菜鸟,请详细地描述问题,不要一句话带过,根据情况贴上使用代码)
作者是个菜鸟,请详细地描述问题,不要一句话带过(特别是将描述放在标题上的),根据情况贴上代码

处理 issue 是件很耗精力的事,请提交 issue 前考虑一下是否把问题说清楚了

#### 产生环境

Expand All @@ -17,6 +19,6 @@

```html
<script>
alert('作者是个菜鸟');
alert('不会贴代码的看这里');
</script>
```
62 changes: 5 additions & 57 deletions example/routers/datetime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,76 +4,24 @@
<yd-cell-group title="常规" class="demo-small-pitch">
<yd-cell-item arrow>
<span slot="left">Time:</span>
<yd-datetime type="time" v-model="datetime1" slot="right"></yd-datetime>
<yd-datetime type="date" :value="datetime1" :init-emit="false" @input="submitAs" slot="right"></yd-datetime>
</yd-cell-item>
<yd-cell-item arrow>
<span slot="left">Day:</span>
<yd-datetime type="day" v-model="datetime2" slot="right"></yd-datetime>
</yd-cell-item>
<yd-cell-item arrow>
<span slot="left">Month:</span>
<yd-datetime type="month" v-model="datetime3" slot="right"></yd-datetime>
</yd-cell-item>
<yd-cell-item arrow>
<span slot="left">Date:</span>
<yd-datetime type="date" v-model="datetime4" slot="right"></yd-datetime>
</yd-cell-item>
<yd-cell-item arrow>
<span slot="left">DateTime:</span>
<yd-datetime type="datetime" v-model="datetime5" slot="right"></yd-datetime>
</yd-cell-item>
<yd-cell-item arrow>
<span slot="left">自定义模板:</span>
<yd-datetime type="date" :yearFormat="yearFormat" :monthFormat="monthFormat" :dayFormat="dayFormat" v-model="datetime6" slot="right"></yd-datetime>
</yd-cell-item>
</yd-cell-group>

<yd-cell-group title="可选时间" class="demo-small-pitch">
<yd-cell-item arrow>
<span slot="left">开始/结束年份:</span>
<yd-datetime startYear="1990" endYear="2020" type="date" v-model="datetime7" slot="right"></yd-datetime>
</yd-cell-item>
<yd-cell-item arrow>
<span slot="left">开始/结束小时:</span>
<yd-datetime startHour="9" endHour="18" type="time" v-model="datetime8" slot="right"></yd-datetime>
</yd-cell-item>
</yd-cell-group>

<yd-cell-group title="限制时间" class="demo-small-pitch">
<yd-cell-item arrow>
<span slot="left">时间段范围:</span>
<yd-datetime ref="datetime" startDate="2012-03-16 15:13" endDate="2019-10-21 22:21" v-model="datetime9" slot="right"></yd-datetime>
</yd-cell-item>
<p slot="bottom" class="demo-cell-bottom-tip">( 2012-03-16 15:13 ~ 2019-10-21 22:21 )</p>
</yd-cell-group>

<yd-button-group>
<yd-button size="large" @click.native="open">手动打开</yd-button>
</yd-button-group>
</yd-layout>
</template>

<script type="text/babel">
export default {
data() {
return {
datetime1: '12:18',
datetime2: '2018-03-29',
datetime3: '2018-03-29',
datetime4: '2018-03-29',
datetime5: '2016-06-06 06:06',
datetime6: '2017-05-11',
datetime7: '',
datetime8: '10:20',
datetime9: '',
yearFormat: '<span style="color:#F00;">{value}<i style="font-size: 12px;margin-left: 1px;">年</i></span>',
monthFormat: '<span style="color:#0BB20C;">{value}<i style="font-size: 12px;margin-left: 1px;">月</i></span>',
dayFormat: '<span style="color:#FFB400;">{value}<i style="font-size: 12px;margin-left: 1px;">日</i></span>'
datetime1: ''
}
},
methods: {
open() {
this.$refs.datetime.open();
submitAs(val) {
console.log(val);
this.$emit('submit-as', val);
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/components/cityselect/src/cityselect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@
return (v && v == this.active['itemValue' + index]) || (n && n === this.active['itemName' + index]) ? 'yd-cityselect-item-active' : '';
},
clearNavTxt(index) {
for (let i = 0; i < this.columnNum; i++) {
for (let i = 0; i <= this.columnNum; i++) {
if (i > index) {
this.nav['txt' + (i + 1)] = '';
this.active['itemValue' + i] = '';
this.active['itemName' + i] = '';
}
}
},
Expand Down

0 comments on commit 996fa68

Please sign in to comment.