Issue #76: done.

This commit is contained in:
chiayin
2023-09-15 14:58:40 +08:00
parent c00123ddcb
commit e1a9e57468

View File

@@ -117,8 +117,7 @@ export default {
updateMax: {
handler: function(newValue, oldValue) {
this.maxTotal = newValue;
newValue !== oldValue ? this.createData() : null;
// newValue !== oldValue ? this.secondToDate(this.maxTotal, 'min') : null;
this.calculateTotalSeconds();
},
},
},
@@ -145,11 +144,7 @@ export default {
const inputValue = parseInt(event.target.value, 10);
const max = parseInt(event.target.dataset.max, 10); // 設定最大值
const min = parseInt(event.target.dataset.min, 10);
if(inputValue > max) {
event.target.value = max.toString().padStart(2, '0');
this.totalSeconds = this.maxTotal;
this.secondToDate(this.maxTotal, 'max');
}else if(inputValue < min) event.target.value= min.toString().padStart(2, '0');
if(inputValue > max) event.target.value = max.toString().padStart(2, '0');else if(inputValue < min) event.target.value= min.toString().padStart(2, '0');
// 數值更新, tUnits 也更新, 並計算 totalSeconds
const dsp = event.target.dataset.tunit;
@@ -293,7 +288,7 @@ export default {
default:
break;
}
this.$emit('total-seconds', this.totalSeconds);
// this.$emit('total-seconds', this.totalSeconds);
}
},
},