17 lines
427 B
JavaScript
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
|
|
}
|