@wetspace/pro-components
Version:
::: tip 基本介绍
65 lines (64 loc) • 2.6 kB
JavaScript
import { defineComponent as K, computed as S, shallowRef as E, onMounted as P, provide as R, openBlock as s, createElementBlock as b, Fragment as d, createElementVNode as p, normalizeClass as u, unref as a, createVNode as m, withCtx as f, renderList as T, createBlock as $, renderSlot as x } from "vue";
import { useNamespace as B, ElTabs as H, ElTabPane as L } from "element-plus";
import { SymbolState as N } from "./symbol.mjs";
import { useSessionStorage as M } from "../../node_modules/.pnpm/@vueuse_core@10.11.1_vue@3.5.12_typescript@5.4.2_/node_modules/@vueuse/core/index.mjs";
import { wetProPageLabelsProps as V } from "./types.mjs";
import j from "./paneitem.vue.mjs";
const D = /* @__PURE__ */ K({
__name: "index",
props: V,
emits: ["labelClick", "labelColse"],
setup(C, { emit: g }) {
const r = B("pro-page-labels"), t = g, n = C, i = M(`${n.appKey}`, {}), k = S(() => Object.values(i.value).sort((e, o) => e.createTime - o.createTime).map((e) => e)), v = (e) => {
t("labelClick", e);
}, h = (e, o) => {
console.log(e), t("labelColse", o, e);
}, _ = (e) => n.activeKey === `${e}`, c = E(""), y = (e) => {
c.value = e.uuid;
};
return P(() => {
}), R(N, {
labelsMap: i
}), (e, o) => (s(), b(d, null, [
p("div", {
class: u([a(r).b()])
}, [
p("div", {
class: u(a(r).e("labels-header"))
}, [
m(a(H), {
"model-value": n.activeKey,
"before-leave": _
}, {
default: f(() => [
(s(!0), b(d, null, T(k.value, (l) => (s(), $(a(L), {
key: l.labelinfo.pageKey,
name: l.labelinfo.pageKey,
label: l.labelinfo.label,
class: "labels-header-item"
}, {
label: f(() => [
m(j, {
"is-home": l.labelinfo.isHome,
"is-open-dropdown": c.value === l.uuid,
label: l.labelinfo.label || "",
loading: l.labelinfo.loading,
close: (w) => h(w, l),
onClick: () => v(l.labelinfo),
onHandRightClick: () => y(l)
}, null, 8, ["is-home", "is-open-dropdown", "label", "loading", "close", "onClick", "onHandRightClick"])
]),
_: 2
}, 1032, ["name", "label"]))), 128))
]),
_: 1
}, 8, ["model-value"])
], 2)
], 2),
x(e.$slots, "default")
], 64));
}
});
export {
D as default
};