2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-12 21:52:26 +03:00

test: fix snapshot inconsistency due to time zone

This commit is contained in:
mengxiong10
2019-11-11 11:16:09 +08:00
parent e2b24fa833
commit 0ff10e170a
6 changed files with 209 additions and 198 deletions
+6 -4
View File
@@ -1,12 +1,12 @@
<template>
<div class="mx-time-columns">
<scrollbar-vertical v-for="(col, i) in columns" :key="i" class="mx-time-column">
<ul :data-type="col.type" @click="handleSelect">
<ul :data-type="col.type" :data-index="i" @click="handleSelect">
<li
v-for="item in col.list"
v-for="(item, j) in col.list"
:key="item.value"
class="cell"
:data-value="item.value"
:data-index="j"
:class="getClasses(item.value)"
>
{{ item.text }}
@@ -177,7 +177,9 @@ export default {
const { target, currentTarget } = evt;
if (target.tagName.toUpperCase() !== 'LI') return;
const type = currentTarget.getAttribute('data-type');
const value = parseInt(target.getAttribute('data-value'), 10);
const colIndex = parseInt(currentTarget.getAttribute('data-index'), 10);
const cellIndex = parseInt(target.getAttribute('data-index'), 10);
const { value } = this.columns[colIndex].list[cellIndex];
this.$emit('select', value, type);
},
},