UNPKG

mine-h5-ui

Version:

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

52 lines (51 loc) 1.9 kB
import { defineComponent as p, mergeModels as s, useModel as y, createElementBlock as a, openBlock as o, normalizeStyle as i, createCommentVNode as k, Fragment as C, renderList as g, unref as d, createBlock as h, toDisplayString as z } from "vue"; import B from "../MeIcon/index.vue.js"; import { useHandler as V } from "./hooks.js"; /*! * mine-h5-ui v2.15.0 * Copyright (c) 2025 biaov * @license MIT */ const b = ["data-disabled"], E = /* @__PURE__ */ p({ name: "MeRate", __name: "index", props: /* @__PURE__ */ s({ icon: { default: "icon-star4" }, iconSelect: { default: "icon-star3" }, color: { default: "#fed835" }, count: { default: 5 }, readonly: { type: Boolean, default: !1 }, disabled: { type: Boolean, default: !1 }, tips: { default: () => ["非常不满意", "不满意", "一般", "满意", "非常满意"] }, tipsColor: { default: "" }, size: { default: "" } }, { modelValue: { default: 0 }, modelModifiers: {} }), emits: /* @__PURE__ */ s(["change"], ["update:modelValue"]), setup(n, { emit: r }) { const u = r, c = n, t = y(n, "modelValue"), { listData: m, onClick: f } = V({ props: c, emit: u, modelValue: t }); return (e, v) => (o(), a("div", { class: "me-rate", style: i(`font-size:${e.size};`), "data-disabled": e.disabled }, [ (o(!0), a(C, null, g(d(m), (l) => (o(), h(B, { key: l.id, name: l.state ? e.iconSelect : e.icon, size: "inherit", color: l.state ? e.color : "#949494", onClick: (M) => d(f)(l) }, null, 8, ["name", "color", "onClick"]))), 128)), e.tips.length > 0 && t.value > 0 ? (o(), a("span", { key: 0, class: "tips", style: i(`color:${e.tipsColor};`) }, z(e.tips[t.value - 1]), 5)) : k("", !0) ], 12, b)); } }); export { E as default };