Files
2026-10-26 17:32:47 +08:00

8 lines
426 B
JavaScript

// 底部导航只属于三个主页面,二级页面由顶部返回按钮导航。
const paths = {home:'pages/index/index',records:'pages/discover/discover',profile:'pages/profile/profile'};
function tabForPage(route) {
const current = String(route || '').replace(/^\//, '').split('?')[0];
return Object.keys(paths).find(function(tab) { return paths[tab] === current; }) || '';
}
module.exports = { tabForPage, paths };