UNPKG

fun-tab

Version:

A mobile touch-swappable tabs component for Vue3

52 lines (47 loc) 1.53 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); var types = require('./types.js'); var pluginVue_exportHelper = require('./_virtual/plugin-vue_export-helper.js'); const _sfc_main = vue.defineComponent({ name: "FunTabBar", props: { modelValue: { type: [String, Number], default: "" }, activeColor: { type: String, default: "#1677ff" } }, emits: ["update:modelValue", "change"], setup(props, { emit }) { const activeValue = vue.ref(props.modelValue); vue.watch(() => props.modelValue, (v) => { activeValue.value = v; }); const setActiveValue = (value) => { activeValue.value = value; emit("update:modelValue", value); emit("change", value); }; vue.provide(types.tabsInjectionKey, { activeValue, activeColor: vue.toRef(props, "activeColor"), setActiveValue }); } }); const _hoisted_1 = { class: "fun-tab-bar" }; const _hoisted_2 = { class: "fun-tab-bar-wrap" }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [ vue.createElementVNode("div", _hoisted_2, [ vue.renderSlot(_ctx.$slots, "default") ]) ]); } var FunTabBar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "/Users/scoutyin/Documents/ScoutYin/fun-tab/src/tab-bar.vue"]]); exports["default"] = FunTabBar; //# sourceMappingURL=tab-bar.js.map