Conformance: time duration component done.
This commit is contained in:
@@ -46,6 +46,13 @@ export default {
|
||||
return value >= 0;
|
||||
},
|
||||
},
|
||||
updateMax: {
|
||||
type: Number,
|
||||
required: false,
|
||||
validator(value) {
|
||||
return value >= 0;
|
||||
},
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: false,
|
||||
@@ -94,9 +101,9 @@ export default {
|
||||
watch: {
|
||||
max: {
|
||||
handler: function(newValue, oldValue) {
|
||||
this.maxTotal = newValue;
|
||||
this.size === 'max' && newValue !== oldValue ? this.createData() : null;
|
||||
},
|
||||
this.maxTotal = newValue;
|
||||
this.size === 'max' && newValue !== oldValue ? this.createData() : null;
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
min: {
|
||||
@@ -105,7 +112,14 @@ export default {
|
||||
this.size === 'min' && newValue !== oldValue ? this.createData() : null;
|
||||
},
|
||||
immediate: true,
|
||||
}
|
||||
},
|
||||
// min 的最大值要等於 max 的總秒數
|
||||
updateMax: {
|
||||
handler: function(newValue, oldValue) {
|
||||
this.maxTotal = newValue;
|
||||
newValue !== oldValue ? this.createData() : null;
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onFocus(event) {
|
||||
@@ -233,7 +247,6 @@ export default {
|
||||
},
|
||||
async createData() {
|
||||
let size = this.size;
|
||||
|
||||
if (this.maxTotal !== await null && this.minTotal !== await null) {
|
||||
switch (size) {
|
||||
case 'max':
|
||||
@@ -255,7 +268,6 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.inputTypes = this.display.split('');
|
||||
// this.createData();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user