UNPKG

mt-ui-components-vue3

Version:

玛果添实UI组件库(Vue3)

101 lines 3.41 kB
/* Analyzed bindings: { "visible": "props", "isEdit": "props", "content": "props", "selected": "props", "index": "props", "name": "props", "getPopupContainer": "props", "placement": "props", "id": "props", "Popover": "setup-maybe-ref", "computed": "setup-const", "props": "setup-reactive-const", "className": "setup-ref" } */ import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, unref as _unref, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock } from "vue"; const _hoisted_1 = { style: { "white-space": "nowrap" } }; const _hoisted_2 = ["data-index", "data-name"]; const _hoisted_3 = ["data-index", "data-name"]; import { Popover } from '../../components'; import { computed } from 'vue'; const __sfc_main__ = { props: { visible: { type: Boolean, default: false, }, isEdit: { type: Boolean, default: false, }, content: { type: String, default: '', }, selected: { type: Boolean, default: false, }, index: { type: Number, default: undefined, }, name: { type: String, default: '', }, getPopupContainer: { type: Function, default: undefined, }, placement: { type: String, default: 'top', }, id: { type: String, default: 'top', }, }, setup(__props) { const props = __props; const className = computed(() => { return { [props.id]: true, 'j-row-selected': true, 'j-row-click': true, 'j-row-selected-active': props.selected, }; }); return (_ctx, _cache) => { return (__props.isEdit) ? (_openBlock(), _createBlock(_unref(Popover), { key: 0, visible: __props.visible, placement: __props.placement, "get-popup-container": __props.getPopupContainer, "auto-adjust-overflow": false }, { content: _withCtx(() => [ _createElementVNode("div", _hoisted_1, _toDisplayString(__props.content), 1 /* TEXT */) ]), default: _withCtx(() => [ _createElementVNode("div", { class: _normalizeClass(className.value), "data-index": __props.index, "data-name": __props.name }, null, 10 /* CLASS, PROPS */, _hoisted_2) ]), _: 1 /* STABLE */ }, 8 /* PROPS */, ["visible", "placement", "get-popup-container"])) : (_openBlock(), _createElementBlock("div", { key: 1, class: _normalizeClass(className.value), "data-index": __props.index, "data-name": __props.name }, null, 10 /* CLASS, PROPS */, _hoisted_3)); }; } }; export default __sfc_main__;