UNPKG

@artmate/chat

Version:

**开箱即用的AI组件库(基于 Vue3 + ElementPlus)**

32 lines (31 loc) 529 B
import { watch as c, ref as m } from "vue"; function y(f, t) { let a; c( () => t, () => { a = (e, r) => typeof t == "function" ? t(e, r) : t ? t[e.role] || {} : {}; }, { immediate: !0 } ); const i = m([]), o = (e) => { const r = (e || []).map((n, u) => { const s = n.key ?? `preset_${u}`; return { ...a(n, u), ...n, key: s }; }); i.value = r; }; return o(f), { ListData: i, setListData: o }; } export { y as default };