问题: el-time-picker筛选出某个时间点保存,以后从后台获取该时间,页面显示spa
`
<el-time-picker class="my_time_picker_32" :clearable="false" v-model="scope.row.plan[index]" placeholder="时间" format="HH:mm"></el-time-picker>
`code
解决: 字符串转dateorm
const _converTime = ac.plan.map((item: any) => { const _arr: string[] = item.split(':'); return new Date(2010, 10, 10, Number(_arr[0]), Number(_arr[1])); });
附:选中的时间点过滤出时分
`
private dateConversion(value: any): string {blog
const d = new Date(value); let _h = d.getHours() + ''; if (_h.length === 1) { _h = '0' + _h; } let _m = d.getMinutes() + ''; if (_m.length === 1) { _m = '0' + _m; } return _h + ':' + _m;
}
`字符串