Skip to content

Commit 435896a

Browse files
committed
Change select from v-bind to v-model
1 parent 7a39a23 commit 435896a

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/components/InputTimeInterval.vue

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ div
1818
th.pr-2
1919
label(for="duration") Show last:
2020
td
21-
select(id="duration" :value="duration" @change="valueChanged")
21+
select(id="duration" v-model="duration" @change="valueChanged")
2222
option(:value="15*60") 15min
2323
option(:value="30*60") 30min
2424
option(:value="60*60") 1h
@@ -74,14 +74,6 @@ export default {
7474
return [moment().subtract(this.duration, 'seconds'), moment()];
7575
}
7676
},
77-
set(newValue) {
78-
if (!isNaN(newValue) && newValue != '') {
79-
// Set new duration
80-
this.duration = newValue;
81-
} else {
82-
// Not required for mode='range', start and end set directly through v-model
83-
}
84-
},
8577
},
8678
emptyDaterange() {
8779
return !(this.start && this.end);
@@ -94,14 +86,11 @@ export default {
9486
},
9587
},
9688
methods: {
97-
valueChanged(e) {
98-
console.log('valueChanged');
89+
valueChanged() {
9990
if (
10091
this.mode == 'last_duration' ||
10192
(!this.emptyDaterange && !this.invalidDaterange && !this.daterangeTooLong)
10293
) {
103-
console.log('entered if');
104-
this.value = e.target.value;
10594
this.$emit('input', this.value);
10695
}
10796
},

0 commit comments

Comments
 (0)