@artmate/chat
Version:
**开箱即用的AI组件库(基于 Vue3 + ElementPlus)**
36 lines (35 loc) • 1.8 kB
JavaScript
import { defineComponent as o, createBlock as a, openBlock as e, Transition as s, mergeProps as i, toHandlers as n, withCtx as p, renderSlot as r } from "vue";
const y = /* @__PURE__ */ o({
__name: "index",
setup(g) {
const d = {
beforeEnter(t) {
t.dataset || (t.dataset = {}), t.dataset.oldPaddingTop = t.style.paddingTop, t.dataset.oldPaddingBottom = t.style.paddingBottom, t.style.maxHeight = 0, t.style.paddingTop = 0, t.style.paddingBottom = 0;
},
enter(t) {
t.dataset.oldOverflow = t.style.overflow, t.scrollHeight === 0 ? (t.style.maxHeight = 0, t.style.paddingTop = t.dataset.oldPaddingTop, t.style.paddingBottom = t.dataset.oldPaddingBottom) : (t.style.maxHeight = `${t.scrollHeight}px`, t.style.paddingTop = t.dataset.oldPaddingTop, t.style.paddingBottom = t.dataset.oldPaddingBottom), t.style.overflow = "hidden";
},
afterEnter(t) {
t.maxHeight = "", t.style.overflow = t.dataset.oldOverflow;
},
beforeLeave(t) {
t.dataset || (t.dataset = {}), t.dataset.oldPaddingTop = t.style.paddingTop, t.dataset.oldPaddingBottom = t.style.paddingBottom, t.dataset.oldOverflow = t.style.overflow, t.style.maxHeight = `${t.scrollHeight}px`, t.style.overflow = "hidden";
},
leave(t) {
t.scrollHeight !== 0 && (t.style.maxHeight = 0, t.style.paddingTop = 0, t.style.paddingBottom = 0);
},
afterLeave(t) {
t.style.maxHeight = "", t.style.overflow = t.dataset.oldOverflow, t.style.paddingTop = t.dataset.oldPaddingTop, t.style.paddingBottom = t.dataset.oldPaddingBottom;
}
};
return (t, l) => (e(), a(s, i({ name: "bt-collapse-transition" }, n(d)), {
default: p(() => [
r(t.$slots, "default")
]),
_: 3
}, 16));
}
});
export {
y as default
};