UNPKG

yanzhen-design-vue

Version:

75 lines (74 loc) 2.99 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const vue = require("vue"); const index = require("../../../avatar/index.cjs"); const contactsItem = require("./contacts-item.cjs"); const useContactsItem = require("./use-contacts-item.cjs"); const _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...{ name: contactsItem.contactsItemName, inheritAttrs: true }, __name: "contacts-item", props: contactsItem.contactsItemProps, emits: contactsItem.contactsItemEmits, setup(__props, { expose: __expose, emit: __emit }) { const { ns } = contactsItem.contactsItemOptions; const props = __props; const emit = __emit; const { ctx: { _ref, _avatar, _label, isSelf, _tags, errorImg }, methods: { handleClick, handleSuffixClick } } = useContactsItem.useContactsItem(props, emit); __expose({ ref: _ref }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock("div", { ref_key: "_ref", ref: _ref, class: vue.normalizeClass([vue.unref(ns).b()]), onClick: _cache[1] || (_cache[1] = vue.withModifiers( //@ts-ignore (...args) => vue.unref(handleClick) && vue.unref(handleClick)(...args), ["stop"] )) }, [ vue.createElementVNode("div", { class: vue.normalizeClass([vue.unref(ns).e("avatar")]) }, [ vue.createVNode(vue.unref(index.YzAvatar), { size: 28, src: vue.unref(_avatar), "err-src": vue.unref(errorImg), text: vue.unref(_label) }, null, 8, ["src", "err-src", "text"]) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass(vue.unref(ns).e("content")) }, [ vue.createElementVNode("span", { class: vue.normalizeClass([vue.unref(ns).e("label")]) }, vue.toDisplayString(vue.unref(_label)), 3), vue.createElementVNode("span", { class: vue.normalizeClass([vue.unref(ns).e("tags")]) }, [ vue.unref(isSelf) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createTextVNode("我自己") ], 64)) : vue.unref(_tags) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ vue.createTextVNode(vue.toDisplayString(vue.unref(_tags)), 1) ], 64)) : vue.createCommentVNode("", true) ], 2) ], 2), vue.createElementVNode("div", { class: vue.normalizeClass([vue.unref(ns).e("suffix")]), onClick: _cache[0] || (_cache[0] = vue.withModifiers( //@ts-ignore (...args) => vue.unref(handleSuffixClick) && vue.unref(handleSuffixClick)(...args), ["stop"] )) }, [ vue.renderSlot(_ctx.$slots, "suffix") ], 2) ], 2); }; } }); exports.default = _sfc_main;