@opentiny/vue-renderless
Version:
An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
23 lines (22 loc) • 531 B
JavaScript
import "../chunk-G2ADBYYC.js";
import { formatDateByPattern as format } from "@opentiny/utils";
const init = ({ state, props }) => () => {
let list = [];
let value;
for (let minutes = props.start; minutes <= props.end; minutes += props.step) {
value = format(new Date(0, 0, 0, 0, minutes, 0), "hh:mm");
list.push({
label: value,
value
});
}
state.options = list;
};
const change = (emit) => (value) => {
emit("update:modelValue", value);
emit("change", value);
};
export {
change,
init
};