diff --git a/src/components/durationjs.vue b/src/components/durationjs.vue index 1f97a36..16756e8 100644 --- a/src/components/durationjs.vue +++ b/src/components/durationjs.vue @@ -80,9 +80,9 @@ export default { tUnits: { get() { return { - s: { dsp: 's', inc: 1, val: this.seconds, max: 60, rate: 1, min: 0 }, - m: { dsp: 'm', inc: 1, val: this.minutes, max: 60, rate: 60, min: 0 }, - h: { dsp: 'h', inc: 1, val: this.hours, max: 24, rate: 3600, min: 0 }, + s: { dsp: 's', inc: 1, val: this.seconds, max: 59, rate: 1, min: 0 }, + m: { dsp: 'm', inc: 1, val: this.minutes, max: 59, rate: 60, min: 0 }, + h: { dsp: 'h', inc: 1, val: this.hours, max: 23, rate: 3600, min: 0 }, d: { dsp: 'd', inc: 1, val: this.days, max: this.maxDays, rate: 86400, min: this.minDays } }; }, @@ -118,6 +118,7 @@ export default { handler: function(newValue, oldValue) { this.maxTotal = newValue; newValue !== oldValue ? this.createData() : null; + // newValue !== oldValue ? this.secondToDate(this.maxTotal, 'min') : null; }, }, }, @@ -263,6 +264,7 @@ export default { if(totalSeconds >= this.maxTotal){ // 大於最大值時要等於最大值 totalSeconds = this.maxTotal; + this.secondToDate(this.maxTotal, 'max'); } else if (totalSeconds <= this.minTotal) { // 小於最小值時要等於最小值 totalSeconds = this.minTotal; this.secondToDate(this.minTotal, 'min');