1 line
6.5 KiB
JSON
1 line
6.5 KiB
JSON
{"ast":null,"code":"import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createBlock as _createBlock, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\";\nconst _withScopeId = n => (_pushScopeId(\"data-v-7b7e5f8e\"), n = n(), _popScopeId(), n);\nconst _hoisted_1 = {\n class: \"tabbar\"\n};\nexport function render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_van_tabbar_item = _resolveComponent(\"van-tabbar-item\");\n const _component_van_tabbar = _resolveComponent(\"van-tabbar\");\n return _openBlock(), _createElementBlock(\"div\", _hoisted_1, [_createVNode(_component_van_tabbar, {\n modelValue: $setup.active,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => $setup.active = $event)\n }, {\n default: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList($setup.tabbar, (item, index) => {\n return _openBlock(), _createBlock(_component_van_tabbar_item, {\n key: index,\n name: item.name,\n onClick: $event => $setup.handleClick(item)\n }, {\n icon: _withCtx(props => [_createElementVNode(\"span\", {\n class: _normalizeClass([\"tab-icon\", {\n active: props.active\n }])\n }, _toDisplayString(item.icon), 3 /* TEXT, CLASS */)]),\n\n default: _withCtx(() => [_createElementVNode(\"span\", {\n class: _normalizeClass([\"tab-text\", {\n active: $setup.active === item.name\n }])\n }, _toDisplayString(item.text), 3 /* TEXT, CLASS */)]),\n\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"name\", \"onClick\"]);\n }), 128 /* KEYED_FRAGMENT */))]),\n\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\"])]);\n}","map":{"version":3,"names":["class","_createElementBlock","_hoisted_1","_createVNode","_component_van_tabbar","$setup","active","$event","_Fragment","_renderList","tabbar","item","index","_createBlock","_component_van_tabbar_item","key","name","onClick","handleClick","icon","_withCtx","props","_createElementVNode","_normalizeClass","text"],"sources":["/Users/li/Desktop/work/work2/OG/GamePortrait/src/components/Tabbar.vue"],"sourcesContent":["<template>\n\t<div class=\"tabbar\">\n\t\t<van-tabbar v-model=\"active\">\n\t\t\t<van-tabbar-item v-for=\"(item, index) in tabbar\" :key=\"index\" :name=\"item.name\" @click=\"handleClick(item)\">\n\t\t\t\t<template #icon=\"props\">\n\t\t\t\t\t<span class=\"tab-icon\" :class=\"{ active: props.active }\">{{ item.icon }}</span>\n\t\t\t\t</template>\n\t\t\t\t<span class=\"tab-text\" :class=\"{ active: active === item.name }\">{{ item.text }}</span>\n\t\t\t</van-tabbar-item>\n\t\t</van-tabbar>\n\t</div>\n</template>\n\n<script>\n\timport {\n\t\tref,\n\t\tonMounted,\n\t\tcomputed,\n\t\twatch\n\t} from \"vue\"\n\timport {\n\t\tuseRouter\n\t} from \"vue-router\"\n\timport {\n\t\tuseStore\n\t} from \"vuex\"\n\timport {\n\t\tTabbar,\n\t\tTabbarItem,\n\t\tshowDialog,\n\t\tshowToast\n\t} from \"vant\"\n\texport default {\n\t\tname: \"TabBar\",\n\t\tcomponents: {\n\t\t\t\"van-tabbar\": Tabbar,\n\t\t\t\"van-tabbar-item\": TabbarItem\n\t\t},\n\t\tsetup() {\n\t\t\tconst router = useRouter()\n\t\t\tconst store = useStore()\n\t\t\tconst Type = computed(() => store.state.config.$Type)\n\t\t\tconst Lang = computed(() => store.state.config.$lang)\n\t\t\tconst active = ref(\"hall\")\n\t\t\t\n\t\t\t// 5个功能图标 - 深色豪华风格\n\t\t\tconst tabbar = ref([\n\t\t\t\t{\n\t\t\t\t\tname: \"hall\",\n\t\t\t\t\ticon: \"🏠\",\n\t\t\t\t\ttext: \"大厅\",\n\t\t\t\t\tto: \"/baccarat\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"statement\",\n\t\t\t\t\ticon: \"📊\",\n\t\t\t\t\ttext: \"报表\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"message\",\n\t\t\t\t\ticon: \"💬\",\n\t\t\t\t\ttext: \"消息\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"record\",\n\t\t\t\t\ticon: \"📝\",\n\t\t\t\t\ttext: \"记录\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: \"profile\",\n\t\t\t\t\ticon: \"👤\",\n\t\t\t\t\ttext: \"我的\"\n\t\t\t\t}\n\t\t\t])\n\n\t\t\tconst handleClick = (item) => {\n\t\t\t\tif (item.to) {\n\t\t\t\t\trouter.push(item.to)\n\t\t\t\t} else {\n\t\t\t\t\t// 功能开发中提示\n\t\t\t\t\tshowToast({\n\t\t\t\t\t\tmessage: Lang.value?.[Type.value]?.msg_waiting_development || \"功能开发中\",\n\t\t\t\t\t\tposition: \"bottom\"\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonMounted(() => {\n\t\t\t\tactive.value = \"hall\"\n\t\t\t})\n\t\t\t\n\t\t\treturn {\n\t\t\t\ttabbar,\n\t\t\t\tactive,\n\t\t\t\thandleClick\n\t\t\t}\n\t\t}\n\t}\n</script>\n<style lang=\"scss\" scoped>\n\t/* 深色豪华风格 Tabbar */\n\t$dark-bg: #1a1a1a;\n\t$gold: #c5a059;\n\t$text-muted: #666666;\n\t\n\t.tabbar {\n\t\tposition: absolute;\n\t\twidth: 100%;\n\t\tleft: 0;\n\t\tbottom: 0;\n\t\tz-index: 25;\n\t\tbackground: $dark-bg;\n\t\tborder-top: 1px solid #333;\n\t}\n\n\t.van-tabbar--fixed {\n\t\tposition: static;\n\t\twidth: 100%;\n\t\theight: 56px;\n\t}\n\n\t.van-tabbar {\n\t\tbackground: $dark-bg !important;\n\t\theight: 56px;\n\t\t\n\t\t&::before {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t.van-tabbar-item {\n\t\tcolor: $text-muted;\n\t\t\n\t\t&--active {\n\t\t\tbackground: transparent !important;\n\t\t\tcolor: $gold !important;\n\t\t}\n\t}\n\n\t.tab-icon {\n\t\tfont-size: 20px;\n\t\tfilter: grayscale(1) opacity(0.5);\n\t\ttransition: all 0.2s ease;\n\t\t\n\t\t&.active {\n\t\t\tfilter: grayscale(0) opacity(1);\n\t\t}\n\t}\n\n\t.tab-text {\n\t\tfont-size: 10px;\n\t\tcolor: $text-muted;\n\t\tmargin-top: 2px;\n\t\t\n\t\t&.active {\n\t\t\tcolor: $gold;\n\t\t}\n\t}\n</style>"],"mappings":";;;EACMA,KAAK,EAAC;AAAQ;;;;uBAAnBC,mBAAA,CASM,OATNC,UASM,GARLC,YAAA,CAOaC,qBAAA;gBAPQC,MAAA,CAAAC,MAAM;+DAAND,MAAA,CAAAC,MAAM,GAAAC,MAAA;;sBACT,MAA+B,E,kBAAhDN,mBAAA,CAKkBO,SAAA,QAAAC,WAAA,CALuBJ,MAAA,CAAAK,MAAM,GAAtBC,IAAI,EAAEC,KAAK;2BAApCC,YAAA,CAKkBC,0BAAA;QALgCC,GAAG,EAAEH,KAAK;QAAGI,IAAI,EAAEL,IAAI,CAACK,IAAI;QAAGC,OAAK,EAAAV,MAAA,IAAEF,MAAA,CAAAa,WAAW,CAACP,IAAI;;QAC5FQ,IAAI,EAAAC,QAAA,CAAEC,KAAK,KACrBC,mBAAA,CAA+E;UAAzEtB,KAAK,EAAAuB,eAAA,EAAC,UAAU;YAAAjB,MAAA,EAAmBe,KAAK,CAACf;UAAM;4BAAOK,IAAI,CAACQ,IAAI,wB;;0BAEtE,MAAuF,CAAvFG,mBAAA,CAAuF;UAAjFtB,KAAK,EAAAuB,eAAA,EAAC,UAAU;YAAAjB,MAAA,EAAmBD,MAAA,CAAAC,MAAM,KAAKK,IAAI,CAACK;UAAI;4BAAOL,IAAI,CAACa,IAAI,wB"},"metadata":{},"sourceType":"module","externalDependencies":[]} |