@wetspace/pro-components
Version:
::: tip 基本介绍
80 lines (79 loc) • 2.69 kB
JavaScript
import { defineComponent as f, openBlock as o, createBlock as l, unref as e, withCtx as n, createVNode as r, createElementBlock as a, Fragment as m, renderList as k, resolveDynamicComponent as y, createElementVNode as i, toDisplayString as c } from "vue";
import { ElSpace as u, ElAvatar as E, ElDropdown as g, ElDropdownMenu as h, ElDropdownItem as w, ElIcon as p } from "element-plus";
import { CaretBottom as C } from "../../node_modules/.pnpm/@element-plus_icons-vue@2.3.1_vue@3.5.12_typescript@5.4.2_/node_modules/@element-plus/icons-vue/dist/index.mjs";
const S = ["src"], D = { key: 1 }, I = /* @__PURE__ */ f({
__name: "person",
props: {
nickname: String,
avatar: {
type: Object,
default() {
return {};
}
},
moreActions: {
type: Array
}
},
setup(d) {
const s = d;
return (b, A) => (o(), l(e(u), { style: { cursor: "pointer" } }, {
default: n(() => [
r(e(E)),
r(e(g), { trigger: "click" }, {
dropdown: n(() => [
r(e(h), null, {
default: n(() => [
(o(!0), a(m, null, k(s.moreActions, (t, _) => (o(), l(e(w), {
key: _,
onClick: t.action
}, {
default: n(() => [
t.icon || t.iconSrc ? (o(), l(e(u), { key: 0 }, {
default: n(() => [
r(e(p), { size: 16 }, {
default: n(() => [
t.iconSrc ? (o(), a("img", {
key: 0,
src: t.iconSrc,
width: "16",
height: "16"
}, null, 8, S)) : (o(), l(y(t.icon), { key: 1 }))
]),
_: 2
}, 1024),
i("span", null, c(t.label), 1)
]),
_: 2
}, 1024)) : (o(), a("span", D, c(t.label), 1))
]),
_: 2
}, 1032, ["onClick"]))), 128))
]),
_: 1
})
]),
default: n(() => [
r(e(u), null, {
default: n(() => [
i("span", null, c(s.nickname || "未登录"), 1),
r(e(p), null, {
default: n(() => [
r(e(C))
]),
_: 1
})
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}));
}
});
export {
I as default
};