mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Add link to easy use on templates
This commit is contained in:
parent
06ae3868fe
commit
ffecaee7bc
@ -14,4 +14,12 @@ export default ({ app, store }) => {
|
||||
'fr': require('~/locales/fr.json')
|
||||
}
|
||||
})
|
||||
|
||||
app.i18n.link = (link) => {
|
||||
if (app.i18n.locale === app.i18n.fallbackLocale) {
|
||||
return `/${link}`
|
||||
}
|
||||
|
||||
return `/${app.i18n.locale}/${link}`
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user