mirror of
https://gitee.com/ElemeFE/element.git
synced 2024-12-04 13:17:47 +08:00
parent
a303c04f9e
commit
fd42bf1efc
@ -14,7 +14,7 @@
|
|||||||
<tr
|
<tr
|
||||||
class="el-date-table__row"
|
class="el-date-table__row"
|
||||||
v-for="row in rows"
|
v-for="row in rows"
|
||||||
:class="{ current: value && isWeekActive(row[1]) }">
|
:class="{ current: isWeekActive(row[1]) }">
|
||||||
<td
|
<td
|
||||||
v-for="cell in row"
|
v-for="cell in row"
|
||||||
:class="getCellClasses(cell)"
|
:class="getCellClasses(cell)"
|
||||||
@ -78,9 +78,7 @@
|
|||||||
column: null
|
column: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
value: {}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -85,7 +85,6 @@
|
|||||||
:year="year"
|
:year="year"
|
||||||
:month="month"
|
:month="month"
|
||||||
:date="date"
|
:date="date"
|
||||||
:value="value"
|
|
||||||
:week="week"
|
:week="week"
|
||||||
:selection-mode="selectionMode"
|
:selection-mode="selectionMode"
|
||||||
:first-day-of-week="firstDayOfWeek"
|
:first-day-of-week="firstDayOfWeek"
|
||||||
@ -127,7 +126,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script type="text/babel">
|
<script type="text/babel">
|
||||||
import { formatDate, parseDate } from '../util';
|
import { formatDate, parseDate, getWeekNumber } from '../util';
|
||||||
import Locale from 'element-ui/src/mixins/locale';
|
import Locale from 'element-ui/src/mixins/locale';
|
||||||
import ElInput from 'element-ui/packages/input';
|
import ElInput from 'element-ui/packages/input';
|
||||||
import TimePicker from './time';
|
import TimePicker from './time';
|
||||||
@ -175,15 +174,14 @@
|
|||||||
if (this.currentView !== 'year' || this.currentView !== 'month') {
|
if (this.currentView !== 'year' || this.currentView !== 'month') {
|
||||||
this.currentView = 'month';
|
this.currentView = 'month';
|
||||||
}
|
}
|
||||||
|
} else if (newVal === 'week') {
|
||||||
|
this.week = getWeekNumber(this.date);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
date(newVal) {
|
date(newVal) {
|
||||||
/* istanbul ignore next */
|
this.year = newVal.getFullYear();
|
||||||
if (!this.year) {
|
this.month = newVal.getMonth();
|
||||||
this.year = newVal.getFullYear();
|
|
||||||
this.month = newVal.getMonth();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -356,10 +354,6 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.selectionMode === 'month') {
|
|
||||||
this.currentView = 'month';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.date && !this.year) {
|
if (this.date && !this.year) {
|
||||||
this.year = this.date.getFullYear();
|
this.year = this.date.getFullYear();
|
||||||
this.month = this.date.getMonth();
|
this.month = this.date.getMonth();
|
||||||
|
@ -407,7 +407,7 @@ export default {
|
|||||||
if (this.$isServer) return;
|
if (this.$isServer) return;
|
||||||
if (!this.picker) {
|
if (!this.picker) {
|
||||||
this.panel.defaultValue = this.currentValue;
|
this.panel.defaultValue = this.currentValue;
|
||||||
this.picker = new Vue(this.panel).$mount(document.createElement('div'));
|
this.picker = new Vue(this.panel).$mount();
|
||||||
this.picker.popperClass = this.popperClass;
|
this.picker.popperClass = this.popperClass;
|
||||||
this.popperElm = this.picker.$el;
|
this.popperElm = this.picker.$el;
|
||||||
this.picker.width = this.reference.getBoundingClientRect().width;
|
this.picker.width = this.reference.getBoundingClientRect().width;
|
||||||
|
Loading…
Reference in New Issue
Block a user