el-plus-powerful-table
Version:
## [DOCS](https://peng-xiao-shuai.github.io/vite-vue-admin-docs/zh-CN/component_directive/component/powerful-table-doc.html)
89 lines (88 loc) • 2.46 kB
JavaScript
import { defineComponent as x, ref as f, computed as w, createVNode as o, withDirectives as v, vShow as p } from "vue";
import { ElIcon as s } from "element-plus";
import { ArrowUp as b, ArrowDown as k } from "@element-plus/icons-vue";
import { powerfulTableComponentProp as y, isData as g, useREmit as T } from "../../powerful-table/src/powerful-table-data.mjs";
import { t as r } from "../../locale/lang.mjs";
import { LangKey as d } from "../../locale/packages.mjs";
const l = /* @__PURE__ */ x({
name: "PTText",
props: {
...y,
prop: {
type: Object,
default: () => ({})
},
listLength: {
type: Number,
default: 0
}
},
emits: ["component-emit"],
setup(e, {
emit: c
}) {
const t = g({
row: e.row,
index: e.index,
props: e.prop
}, e.prop.data), {
REmit: m,
event: u
} = T(c, "text", {
row: e.row,
index: e.index,
props: e.prop
}), n = f(Array.from({
length: e.listLength
}).fill(!1)), a = w(() => t && typeof t.formatting == "function" ? t.formatting({
row: e.row,
index: e.index,
props: e.prop
}) : e.row[e.prop.prop]);
return () => o("div", {
class: {
content: n.value[e.index || 0]
}
}, [o("div", {
onClick: (i) => {
i.stopPropagation(), m("click", {
row: e.row,
index: e.index,
prop: e.prop.prop,
evt: i
}), u("click", i);
},
title: a.value,
style: t ? {
display: "-webkit-box",
overflow: "hidden",
"-webkit-box-orient": "vertical",
"word-break": "break-all",
"-webkit-line-clamp": n.value[e.index || 0] ? 99999 : t && t.line || 3
} : {}
}, [a.value]), v(o("div", {
class: "develop",
onClick: (i) => {
i.stopPropagation(), n.value[e.index || 0] = !n.value[e.index || 0];
}
}, [o("span", {
style: {
position: n.value[e.index || 0] ? "absolute" : "static",
display: "flex",
"justify-content": "center",
"align-items": "center"
}
}, [n.value[e.index || 0] ? r(d.PackUp) : r(d.ReadFullText), o(s, null, {
default: () => [n.value[e.index || 0] ? o(b, null, null) : o(k, null, null)]
})])]), [[p, t && t.develop]])]);
}
});
l.install = (e) => {
e.component(l.name, l);
};
const L = l;
export {
L as PTText,
l as default
};
//# sourceMappingURL=text.mjs.map