tk-eui-plus
Version:
174 lines (173 loc) • 5.97 kB
JavaScript
import { defineComponent as D, resolveComponent as l, openBlock as e, createElementBlock as o, createVNode as f, withCtx as k, Fragment as m, renderList as u, createBlock as y, unref as h, createCommentVNode as c, createElementVNode as g, toDisplayString as a, createTextVNode as E, normalizeClass as T, resolveDynamicComponent as q } from "vue";
const w = (n) => n.replace(/(A-Z)g/, "-$1"), F = { class: "list-tabs__item" }, O = ["onClick"], S = {
key: 0,
class: "avatar"
}, Z = { class: "content" }, j = { class: "title" }, G = { key: 0 }, H = {
key: 0,
class: "desc"
}, J = {
key: 1,
class: "time"
}, K = { class: "actions" }, M = ["onClick"], P = {
key: 0,
class: "a-icon"
}, Q = {
key: 1,
class: "a-text"
}, R = /* @__PURE__ */ D({
__name: "index",
props: {
//列表的内容
list: {
type: Array,
required: !0
},
//操作的内容
actions: {
type: Array,
default: () => []
}
},
emits: ["clickItem", "clickAction"],
setup(n, { emit: v }) {
let i = n;
console.log(i.list), console.log(i.actions);
let r = v, p = (_, d) => {
r("clickItem", { item: _, index: d });
}, C = (_, d) => {
r("clickAction", { item: _, index: d });
};
return (_, d) => {
const A = l("el-avatar"), N = l("tk-tag"), L = l("el-scrollbar"), V = l("tk-tab-pane"), $ = l("tk-tabs");
return e(), o("div", F, [
f($, null, {
default: k(() => [
(e(!0), o(
m,
null,
u(n.list, (x, z) => (e(), y(V, {
key: z,
label: x.title
}, {
default: k(() => [
f(
L,
{ "max-height": "300px" },
{
default: k(() => [
(e(!0), o(
m,
null,
u(x.content, (t, s) => (e(), o("div", {
class: "container",
key: s,
onClick: (B) => h(p)(t, s)
}, [
t.avatar ? (e(), o("div", S, [
f(A, {
src: t.avatar,
size: "small"
}, null, 8, ["src"])
])) : c("v-if", !0),
g("div", Z, [
g("div", j, [
t.title ? (e(), o(
"div",
G,
a(t.title),
1
/* TEXT */
)) : c("v-if", !0),
t.tag ? (e(), y(N, {
key: 1,
type: t.tagType,
size: "small"
}, {
default: k(() => [
E(
a(t.tag),
1
/* TEXT */
)
]),
_: 2
/* DYNAMIC */
}, 1032, ["type"])) : c("v-if", !0)
]),
t.desc ? (e(), o(
"div",
H,
a(t.desc),
1
/* TEXT */
)) : c("v-if", !0),
t.time ? (e(), o(
"div",
J,
a(t.time),
1
/* TEXT */
)) : c("v-if", !0)
])
], 8, O))),
128
/* KEYED_FRAGMENT */
))
]),
_: 2
/* DYNAMIC */
},
1024
/* DYNAMIC_SLOTS */
),
g("div", K, [
(e(!0), o(
m,
null,
u(n.actions, (t, s) => (e(), o("div", {
class: T(["a-item", { border: s !== n.actions.length }]),
key: s,
onClick: (B) => h(C)(t, s)
}, [
t.icon ? (e(), o("div", P, [
(e(), y(q(`tk-icon-${h(w)(t.icon)}`)))
])) : c("v-if", !0),
t.text ? (e(), o(
"div",
Q,
a(t.text),
1
/* TEXT */
)) : c("v-if", !0)
], 10, M))),
128
/* KEYED_FRAGMENT */
))
])
]),
_: 2
/* DYNAMIC */
}, 1032, ["label"]))),
128
/* KEYED_FRAGMENT */
))
]),
_: 1
/* STABLE */
})
]);
};
}
}), U = (n, v) => {
const i = n.__vccOpts || n;
for (const [r, p] of v)
i[r] = p;
return i;
}, W = /* @__PURE__ */ U(R, [["__scopeId", "data-v-31af12e5"]]), Y = {
install(n) {
n.component("tkNotifiList", W);
}
};
export {
Y as default
};