chore: initial import
This commit is contained in:
16
utils/navigation-title.js
Normal file
16
utils/navigation-title.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user