mirror of
https://github.com/requarks/wiki.git
synced 2026-08-17 16:24:47 -05:00
fix: handle breadcrumb locale prefix correctly
This commit is contained in:
Vendored
+1
-1
@@ -8,7 +8,7 @@
|
|||||||
"vue"
|
"vue"
|
||||||
],
|
],
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": true
|
"source.fixAll.eslint": "explicit"
|
||||||
},
|
},
|
||||||
"i18n-ally.localesPaths": [
|
"i18n-ally.localesPaths": [
|
||||||
"server/locales"
|
"server/locales"
|
||||||
|
|||||||
@@ -476,7 +476,11 @@ export default {
|
|||||||
window.location.assign('/logout')
|
window.location.assign('/logout')
|
||||||
},
|
},
|
||||||
goHome () {
|
goHome () {
|
||||||
window.location.assign('/')
|
if (this.locales && this.locales.length > 0) {
|
||||||
|
window.location.assign(`/${this.locale}/home`)
|
||||||
|
} else {
|
||||||
|
window.location.assign('/')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -367,6 +367,8 @@ import _ from 'lodash'
|
|||||||
import ClipboardJS from 'clipboard'
|
import ClipboardJS from 'clipboard'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
|
/* global siteLangs */
|
||||||
|
|
||||||
Vue.component('Tabset', Tabset)
|
Vue.component('Tabset', Tabset)
|
||||||
|
|
||||||
Prism.plugins.autoloader.languages_path = '/_assets/js/prism/'
|
Prism.plugins.autoloader.languages_path = '/_assets/js/prism/'
|
||||||
@@ -493,6 +495,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
locales: siteLangs,
|
||||||
navShown: false,
|
navShown: false,
|
||||||
navExpanded: false,
|
navExpanded: false,
|
||||||
upBtnShown: false,
|
upBtnShown: false,
|
||||||
@@ -537,10 +540,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
breadcrumbs() {
|
breadcrumbs() {
|
||||||
return [{ path: `/${this.locale}`, name: 'Home' }].concat(
|
return [{ path: '/', name: 'Home' }].concat(
|
||||||
_.reduce(this.path.split('/'), (result, value) => {
|
_.reduce(this.path.split('/'), (result, value) => {
|
||||||
result.push({
|
result.push({
|
||||||
path: _.get(_.last(result), 'path', `/${this.locale}`) + `/${value}`,
|
path: _.get(_.last(result), 'path', this.locales.length > 0 ? `/${this.locale}` : '') + `/${value}`,
|
||||||
name: value
|
name: value
|
||||||
})
|
})
|
||||||
return result
|
return result
|
||||||
@@ -650,7 +653,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
goHome () {
|
goHome () {
|
||||||
window.location.assign('/')
|
if (this.locales && this.locales.length > 0) {
|
||||||
|
window.location.assign(`/${this.locale}/home`)
|
||||||
|
} else {
|
||||||
|
window.location.assign('/')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toggleNavigation () {
|
toggleNavigation () {
|
||||||
this.navOpen = !this.navOpen
|
this.navOpen = !this.navOpen
|
||||||
|
|||||||
Reference in New Issue
Block a user