mine-h5-ui
Version:
一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍
23 lines (22 loc) • 805 B
JavaScript
import { ref as n, computed as m, provide as r, onMounted as p } from "vue";
import { MeTabKey as l } from "./token.js";
/*!
* mine-h5-ui v2.15.0
* Copyright (c) 2025 biaov
* @license MIT
*/
const g = ({ emit: u, currentValue: o }) => {
const s = n(), e = n([]), i = n(0), a = n(0), v = () => {
i.value = s.value.offsetWidth / (e.value.length * 2), a.value = 0;
}, c = ({ name: t }) => {
t !== o.value && (a.value = 0.4, o.value = t, u("change", t));
}, d = (t) => {
e.value.push(t);
}, f = m(() => e.value.findIndex((t) => t.name === o.value));
return r(l, { name: l, currentValue: o, getLabelName: d }), p(() => {
v();
}), { tabsDom: s, tabList: e, transX: i, duration: a, curIndex: f, onClick: c };
};
export {
g as useInitSlots
};