UNPKG

yuang-framework-ui-pc

Version:

yuang-framework-ui-pc Library

65 lines (64 loc) 2.61 kB
"use strict"; const vue = require("vue"); const elementPlus = require("element-plus"); const icons = require("../icons"); const props$1 = require("../ele-tabs/props"); const props = require("./props"); const _sfc_main = vue.defineComponent({ name: "EleTabTool", components: { ElIcon: elementPlus.ElIcon, CornerLeftFilled: icons.CornerLeftFilled, CornerRightFilled: icons.CornerRightFilled }, props: props.tabToolProps, setup(props2) { const wrapProps = vue.inject(props$1.TAB_WRAP_KEY, null); const handleItemClick = (e) => { if (wrapProps && wrapProps.triggerTabItemClick) { wrapProps.triggerTabItemClick(void 0, props2.tabName, e); } }; const handleItemContextmenu = (e) => { if (wrapProps && wrapProps.triggerItemContextMenu) { wrapProps.triggerItemContextMenu(void 0, props2.tabName, e); } }; return { handleItemClick, handleItemContextmenu }; } }); const _export_sfc = (sfc, props2) => { const target = sfc.__vccOpts || sfc; for (const [key, val] of props2) { target[key] = val; } return target; }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_CornerLeftFilled = vue.resolveComponent("CornerLeftFilled"); const _component_ElIcon = vue.resolveComponent("ElIcon"); const _component_CornerRightFilled = vue.resolveComponent("CornerRightFilled"); return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass(["ele-tab-tool", { "is-tab": _ctx.tab }, { "is-active": _ctx.active }]) }, [ _ctx.tab ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ vue.createElementVNode("div", { class: "ele-tab-title", onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleItemClick && _ctx.handleItemClick(...args)), onContextmenu: _cache[1] || (_cache[1] = (...args) => _ctx.handleItemContextmenu && _ctx.handleItemContextmenu(...args)) }, [ vue.renderSlot(_ctx.$slots, "default") ], 32), vue.createVNode(_component_ElIcon, { class: "ele-tab-corner-left" }, { default: vue.withCtx(() => [ vue.createVNode(_component_CornerLeftFilled) ]), _: 1 }), vue.createVNode(_component_ElIcon, { class: "ele-tab-corner-right" }, { default: vue.withCtx(() => [ vue.createVNode(_component_CornerRightFilled) ]), _: 1 }) ], 64)) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }) ], 2); } const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); module.exports = index;