Files
QSY-lvjuxcx/utils/navigation-title.js
2026-06-29 09:42:53 +08:00

17 lines
427 B
JavaScript

import { getGlobalMessage, normalizeLocale } from './i18n'
export function getNavigationTitle(route = '', locale) {
return getGlobalMessage('navigation.routes', normalizeLocale(locale), String(route || '').trim())
}
export function syncNavigationBarTitle(route = '', locale) {
const title = getNavigationTitle(route, locale)
if (!title) {
return ''
}
uni.setNavigationBarTitle({
title
})
return title
}