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 {
7878 return acc
7979 }, {})
8080 },
81+ periodIndex (){
82+ return this .periods .reduce ((acc , p , i ) => {
83+ acc[p .id ] = i
84+ return acc
85+ })
86+ },
8187 computedFields (){
8288 return this .fields .map ((f ) => new Field (f .id , f .items ))
8389 },
@@ -151,11 +157,12 @@ export default {
151157
152158 period: {
153159 attrs: {
154- value: this .selectedPeriod .value
160+ value: this .selectedPeriod .id
155161 },
156162 events: {
157- input : (evt ) => {
158- this .selectedPeriod = evt
163+ input : (periodId ) => {
164+ let i = this .periodIndex [periodId] || 0
165+ this .selectedPeriod = this .periods [i]
159166 }
160167 },
161168 items: this .periods ,
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ type CronState = {
1515 } > ,
1616 period : {
1717 attrs : {
18- value : Array < string > //array of period ids
18+ value : string //selected period id
1919 } ,
2020 events : {
21- input : ( arg1 : Period ) => void
21+ input : ( periodId : string ) => void
2222 } ,
2323 items : Array < Period > ,
2424 prefix : string ,
Original file line number Diff line number Diff line change 55 <v-row align =" baseline" dense >
66 <v-col v-if =" period.prefix" class =" flex-grow-0" >{{period.prefix}}</v-col >
77 <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 >
99 </v-col >
1010 <v-col v-if =" period.suffix" class =" flex-grow-0" >{{period.suffix}}</v-col >
1111
You can’t perform that action at this time.
0 commit comments