yanzhen-design-vue
Version:
32 lines (31 loc) • 1.1 kB
JavaScript
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createVNode, mergeProps, isRef } from "vue";
import { tabsName, tabsProps, tabsEmits, tabsOptions } from "./tabs.mjs";
import { useTabs } from "./useTabs.mjs";
const _sfc_main = /* @__PURE__ */ defineComponent({
...{ name: tabsName },
__name: "tabs",
props: tabsProps,
emits: tabsEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const { ns } = tabsOptions;
const props = __props;
const emit = __emit;
const [{ _ref, activeKey, proxyProps }, Tabs] = useTabs(props, emit);
__expose({
ref: _ref
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass([unref(ns).b()])
}, [
createVNode(unref(Tabs), mergeProps(unref(proxyProps), {
"active-key": unref(activeKey),
"onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => isRef(activeKey) ? activeKey.value = $event : null)
}), null, 16, ["active-key"])
], 2);
};
}
});
export {
_sfc_main as default
};