sd-component-library
Version:
A Vue3 + Element Plus components library
76 lines (75 loc) • 2.35 kB
JavaScript
import { _ as y } from "./index.vue_vue_type_script_setup_true_lang-5fJV14pf.js";
import { defineComponent as x, computed as k, createElementBlock as n, openBlock as a, createCommentVNode as i, createElementVNode as u, normalizeClass as d, unref as m, normalizeStyle as p, Fragment as C, renderList as V, createBlock as _, toDisplayString as h } from "vue";
import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const L = { class: "flex align-center" }, S = ["onClick"], A = /* @__PURE__ */ x({
__name: "index",
props: {
modelValue: {
type: String,
default: ""
},
defaultActive: {
type: String,
default: ""
},
steps: {
type: Array,
default: () => []
},
amount: {
type: Boolean,
default: () => !1
},
space: {
type: Number,
default: 32
}
},
emits: ["update:modelValue"],
setup(e, { emit: f }) {
const s = e, v = f, l = k({
get() {
return s.modelValue || s.defaultActive;
},
set(o) {
v("update:modelValue", o);
}
});
return (o, r) => {
const g = y;
return a(), n("div", L, [
e.amount ? (a(), n("span", {
key: 0,
class: d(["pointer", { "active-step": m(l) === "all" }]),
style: { marginLeft: "24px" },
onClick: r[0] || (r[0] = (t) => l.value = "all")
}, " 全部 ", 2)) : i("", !0),
u("div", {
class: "separator",
style: p({ marginLeft: e.space + "px" })
}, null, 4),
(a(!0), n(C, null, V(e.steps, (t) => {
var c;
return a(), n("div", {
key: t.value,
class: "flex align-center pointer",
style: p({ gap: e.space + "px", marginLeft: e.space + "px" }),
onClick: (N) => l.value = t.value
}, [
u("span", {
class: d({ "active-step": m(l) === t.value })
}, h(t.label), 3),
t.value !== ((c = e.steps[e.steps.length - 1]) == null ? void 0 : c.value) ? (a(), _(g, {
key: 0,
"icon-class": "right-arrow",
"class-name": "arrow-right"
})) : i("", !0)
], 12, S);
}), 128))
]);
};
}
}), z = /* @__PURE__ */ B(A, [["__scopeId", "data-v-310850d0"]]);
export {
z as default
};