UNPKG

yuang-framework-ui-pc

Version:

yuang-framework-ui-pc Library

73 lines (72 loc) 2.12 kB
"use strict"; const vue = require("vue"); const props$1 = require("../ele-tabs/props"); const props = require("./props"); const _sfc_main = vue.defineComponent({ name: "EleTabWrap", props: props.tabWrapProps, setup(props2) { const tabMethods = {}; const data = vue.reactive({ size: props2.size, type: props2.type, setTabMethods: (methods) => { tabMethods.triggerTabItemClick = methods.triggerTabItemClick; tabMethods.triggerItemContextMenu = methods.triggerItemContextMenu; }, triggerTabItemClick: (item, tabName, e) => { if (tabMethods.triggerTabItemClick) { tabMethods.triggerTabItemClick(item, tabName, e); } }, triggerItemContextMenu: (item, tabName, e) => { if (tabMethods.triggerItemContextMenu) { tabMethods.triggerItemContextMenu(item, tabName, e); } } }); vue.provide(props$1.TAB_WRAP_KEY, data); vue.watch( () => props2.size, () => { data.size = props2.size; } ); vue.watch( () => props2.type, () => { data.type = props2.type; } ); vue.onBeforeMount(() => { tabMethods.triggerTabItemClick = void 0; tabMethods.triggerItemContextMenu = void 0; }); return {}; } }); 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) { return vue.openBlock(), vue.createElementBlock("div", { class: vue.normalizeClass([ "ele-tab-wrap", "ele-tabs-wrap", { "is-small": _ctx.size === "small" }, { "is-large": _ctx.size === "large" }, { "is-simple": _ctx.type === "simple" }, { "is-indicator": _ctx.type === "indicator" }, { "is-button": _ctx.type === "button" }, { "is-tag": _ctx.type === "tag" } ]) }, [ vue.renderSlot(_ctx.$slots, "default") ], 2); } const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); module.exports = index;