mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
17 lines (16 loc) • 538 B
JavaScript
import { ref as f, watch as i } from "vue";
const h = ({ props: e, emit: o, modelValue: r }) => {
const a = f(Array.from({ length: e.count }, (t, n) => ({ id: n + 1, state: !1 }))), u = ({ id: t, state: n }) => {
n && !a.value[t].state || e.disabled || e.readonly || (r.value = t, o("change"), a.value.forEach((c) => {
c.state = c.id <= t;
}));
}, s = () => {
a.value.forEach((t) => {
t.state = t.id <= r.value;
});
};
return i(r, s), s(), { listData: a, onClick: u };
};
export {
h as useHandler
};