File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,12 @@ export default {
78
78
return acc
79
79
}, {})
80
80
},
81
+ periodIndex (){
82
+ return this .periods .reduce ((acc , p , i ) => {
83
+ acc[p .id ] = i
84
+ return acc
85
+ })
86
+ },
81
87
computedFields (){
82
88
return this .fields .map ((f ) => new Field (f .id , f .items ))
83
89
},
@@ -151,11 +157,12 @@ export default {
151
157
152
158
period: {
153
159
attrs: {
154
- value: this .selectedPeriod .value
160
+ value: this .selectedPeriod .id
155
161
},
156
162
events: {
157
- input : (evt ) => {
158
- this .selectedPeriod = evt
163
+ input : (periodId ) => {
164
+ let i = this .periodIndex [periodId] || 0
165
+ this .selectedPeriod = this .periods [i]
159
166
}
160
167
},
161
168
items: this .periods ,
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ type CronState = {
15
15
} > ,
16
16
period : {
17
17
attrs : {
18
- value : Array < string > //array of period ids
18
+ value : string //selected period id
19
19
} ,
20
20
events : {
21
- input : ( arg1 : Period ) => void
21
+ input : ( periodId : string ) => void
22
22
} ,
23
23
items : Array < Period > ,
24
24
prefix : string ,
Original file line number Diff line number Diff line change 5
5
<v-row align =" baseline" dense >
6
6
<v-col v-if =" period.prefix" class =" flex-grow-0" >{{period.prefix}}</v-col >
7
7
<v-col cols =" auto" >
8
- <v-select class =" fit" v-bind =" period.attrs" :items =" period.items" @input =" period.events.input" return-object dense ></v-select >
8
+ <v-select class =" fit" v-bind =" period.attrs" :items =" period.items" @input =" period.events.input" item-value = " id " dense ></v-select >
9
9
</v-col >
10
10
<v-col v-if =" period.suffix" class =" flex-grow-0" >{{period.suffix}}</v-col >
11
11
You can’t perform that action at this time.
0 commit comments