UNPKG

mine-h5-ui

Version:

一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍

22 lines (21 loc) 648 B
import { ref as f, watch as i } from "vue"; /*! * mine-h5-ui v2.15.0 * Copyright (c) 2025 biaov * @license MIT */ 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 };