@artmate/chat
Version:
**开箱即用的AI组件库(基于 Vue3 + ElementPlus)**
51 lines (50 loc) • 1.91 kB
JavaScript
import { defineComponent as b, useSlots as h, computed as S, createElementBlock as m, openBlock as t, normalizeStyle as i, normalizeClass as g, Fragment as z, renderList as p, createBlock as B, unref as l, createSlots as N, withCtx as $, renderSlot as v, mergeProps as E } from "vue";
import { useNamespace as w } from "../hooks/useNamespace.js";
import F from "./hooks/useCollapsible.js";
import I from "./item.vue.js";
/* empty css */
const G = /* @__PURE__ */ b({
__name: "index",
props: {
items: { default: () => [] },
collapsible: { type: Boolean, default: !1 },
size: { default: "middle" },
styles: { default: () => ({}) },
classNames: { default: () => ({}) },
prefixCls: { default: "" },
rootClassName: { default: "" },
rootStyle: {}
},
setup(u) {
const e = u, d = h(), a = w("thought-chain"), [f, y, _] = F(e.collapsible), k = S(() => [a.b(), e.rootClassName, e.prefixCls, a.b(e.size)]);
return (x, K) => (t(), m("div", {
class: g(k.value),
style: i(e.rootStyle)
}, [
(t(!0), m(z, null, p(e.items, (s, o) => {
var r, n;
return t(), B(I, {
key: s.key || `key_${o}`,
"class-name": (r = e.classNames) == null ? void 0 : r.item,
style: i(e.styles.item),
styles: e.styles,
info: { ...s },
"header-click": l(_),
"next-status": ((n = e.items[o + 1]) == null ? void 0 : n.status) || s.status,
"enable-collapse": l(f),
"expanded-keys": l(y)
}, N({ _: 2 }, [
p(d, (L, c) => ({
name: c,
fn: $((C) => [
v(x.$slots, c, E({ ref_for: !0 }, { ...C }))
])
}))
]), 1032, ["class-name", "style", "styles", "info", "header-click", "next-status", "enable-collapse", "expanded-keys"]);
}), 128))
], 6));
}
});
export {
G as default
};