mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
51 lines (50 loc) • 1.67 kB
JavaScript
import { defineComponent as g, openBlock as n, createElementBlock as l, normalizeClass as u, unref as o, createElementVNode as s, Fragment as c, renderList as a, withDirectives as S, toDisplayString as r, vShow as w } from "vue";
import x from "./countryData.js";
import { useScroll as y, useBtns as D } from "./hooks.js";
import { name as d } from "./config.js";
const L = { class: "list-rt" }, E = ["onClick"], N = { class: "list-item" }, $ = ["onClick"], A = /* @__PURE__ */ g({
name: d,
__name: "index",
props: {
list: { default: () => x },
range: { default: 10 }
},
emits: ["click"],
setup(i, { emit: m }) {
const f = m, k = i, { curLetter: _, listCont: C, filterShow: h, onClickBadge: p } = y(k), { handleLi: v } = D(f);
return (z, F) => (n(), l("div", {
ref: "indexBarNode",
class: u(o(d))
}, [
s("ul", L, [
(n(!0), l(c, null, a(i.list, (e, t) => S((n(), l("li", {
key: e.name,
class: u({ on: e.name === o(_) }),
onClick: (B) => o(p)(e, t)
}, r(e.name), 11, E)), [
[w, o(h)(t)]
])), 128))
]),
s("ul", {
ref_key: "listCont",
ref: C,
class: "list-cont"
}, [
(n(!0), l(c, null, a(i.list, (e) => (n(), l("li", {
key: e.name
}, [
s("dl", N, [
s("dt", null, r(e.name), 1),
(n(!0), l(c, null, a(e.cities, (t) => (n(), l("dd", {
key: t.code,
onClick: (B) => o(v)(t)
}, r(t.code) + "(" + r(t.cn) + ")", 9, $))), 128))
])
]))), 128))
], 512)
], 2));
}
});
export {
A as default
};