2024-09-19 07:20:14 +08:00
|
|
|
"use strict";
|
|
|
|
const common_vendor = require("../common/vendor.js");
|
|
|
|
const store_routers = require("../store/routers.js");
|
|
|
|
const _sfc_main = {
|
|
|
|
__name: "Tabbar",
|
|
|
|
setup(__props) {
|
|
|
|
const routersStore = store_routers.useRoutersStore();
|
|
|
|
function switchTab(item) {
|
|
|
|
routersStore.setCurrentTab(item.pagePath);
|
2024-10-01 09:15:35 +08:00
|
|
|
if (item.pagePath === "/pages/index/index") {
|
|
|
|
common_vendor.index.switchTab({ url: "/pages/index/index" });
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
common_vendor.index.navigateTo({
|
2024-09-19 07:20:14 +08:00
|
|
|
url: item.pagePath
|
|
|
|
});
|
|
|
|
}
|
|
|
|
return (_ctx, _cache) => {
|
|
|
|
return {
|
|
|
|
a: common_vendor.f(common_vendor.unref(routersStore).tabList, (item, index, i0) => {
|
|
|
|
return {
|
|
|
|
a: common_vendor.unref(routersStore).selected === index ? item.selectedIconPath : item.iconPath,
|
|
|
|
b: common_vendor.t(item.text),
|
|
|
|
c: index,
|
|
|
|
d: common_vendor.unref(routersStore).selected === index ? 1 : "",
|
|
|
|
e: common_vendor.o(($event) => switchTab(item), index)
|
|
|
|
};
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
wx.createComponent(_sfc_main);
|