UNPKG

@wocwin/t-ui-plus

Version:

Page level components developed based on Element Plus.

92 lines (87 loc) 2.91 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); const _hoisted_1 = { class: "t_tabs" }; var _sfc_main = /* @__PURE__ */ vue.defineComponent({ ...{ name: "TTabs" }, __name: "index", props: { tabs: { default: () => [] } }, emits: ["tabsChange"], setup(__props, { expose: __expose, emit: __emit }) { const props = __props; const slots = vue.useSlots(); const activeName = vue.ref(props.tabs && props.tabs[0].key); const emit = __emit; const setSelectedTab = (key) => { activeName.value = key; }; __expose({ setSelectedTab }); return (_ctx, _cache) => { const _component_el_tab_pane = vue.resolveComponent("el-tab-pane"); const _component_el_tabs = vue.resolveComponent("el-tabs"); return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createVNode(_component_el_tabs, vue.mergeProps({ modelValue: activeName.value, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeName.value = $event) }, _ctx.$attrs), vue.createSlots({ default: vue.withCtx(() => [ (vue.openBlock(true), vue.createElementBlock( vue.Fragment, null, vue.renderList(_ctx.tabs, (tab) => { return vue.openBlock(), vue.createBlock( _component_el_tab_pane, vue.mergeProps({ key: tab.key }, { name: tab.key, label: tab.title, ...tab.bind }), vue.createSlots({ default: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, tab.key) ]), _: 2 /* DYNAMIC */ }, [ vue.renderList(vue.unref(slots), (_index, name) => { return { name, fn: vue.withCtx((data) => [ vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(data))) ]) }; }) ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */ ); }), 128 /* KEYED_FRAGMENT */ )) ]), _: 2 /* DYNAMIC */ }, [ vue.renderList(vue.unref(slots), (_index, name) => { return { name, fn: vue.withCtx((data) => [ vue.renderSlot(_ctx.$slots, name, vue.normalizeProps(vue.guardReactiveProps(data))) ]) }; }) ]), 1040, ["modelValue"]) ]); }; } }); exports.default = _sfc_main;