Add feature: allow spinner to have steps
This ads the possibility to choose `steps` in the formatting of the lists. So we can have ”5 in five minutes” or ”every 15 minutes” instead of having always lists of 60 items/minutes.
This commit is contained in:
parent
f3c6cd68d1
commit
9b37683241
5 changed files with 54 additions and 38 deletions
|
@ -1,3 +1,4 @@
|
|||
import Vue from 'vue';
|
||||
import Picker from '../picker.vue';
|
||||
import DatePanel from '../panel/date.vue';
|
||||
import DateRangePanel from '../panel/date-range.vue';
|
||||
|
@ -31,6 +32,7 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
this.panel = getPanel(this.type);
|
||||
const panel = getPanel(this.type);
|
||||
this.Panel = new Vue(panel);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import Vue from 'vue';
|
||||
import Picker from '../picker.vue';
|
||||
import TimePanel from '../panel/time.vue';
|
||||
import TimeRangePanel from '../panel/time-range.vue';
|
||||
|
@ -21,6 +22,10 @@ export default {
|
|||
},
|
||||
default: 'time'
|
||||
},
|
||||
steps: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
value: {}
|
||||
},
|
||||
created () {
|
||||
|
@ -31,6 +36,11 @@ export default {
|
|||
this.currentValue = '';
|
||||
}
|
||||
}
|
||||
this.panel = getPanel(this.type);
|
||||
const Panel = Vue.extend(getPanel(this.type));
|
||||
this.Panel = new Panel({
|
||||
propsData: {
|
||||
steps: this.steps
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue