File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 7
7
</template >
8
8
9
9
<script >
10
+ import { domTitle , setDocumentTitle } from ' @/utils/domUtil'
11
+ import { i18nRender } from ' @/locales'
12
+
10
13
export default {
11
14
data () {
12
15
return {
13
16
}
14
17
},
15
18
computed: {
16
19
locale () {
20
+ // 只是为了切换语言时,更新标题
21
+ const { title } = this .$route .meta
22
+ title && (setDocumentTitle (` ${ i18nRender (title)} - ${ domTitle} ` ))
23
+
17
24
return this .$i18n .getLocaleMessage (this .$store .getters .lang ).antLocale
18
25
}
19
26
},
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import '@/components/NProgress/nprogress.less' // progress bar custom style
6
6
import notification from 'ant-design-vue/es/notification'
7
7
import { setDocumentTitle , domTitle } from '@/utils/domUtil'
8
8
import { ACCESS_TOKEN } from '@/store/mutation-types'
9
+ import { i18nRender } from '@/locales'
9
10
10
11
NProgress . configure ( { showSpinner : false } ) // NProgress Configuration
11
12
@@ -15,7 +16,7 @@ const defaultRoutePath = '/dashboard/workplace'
15
16
16
17
router . beforeEach ( ( to , from , next ) => {
17
18
NProgress . start ( ) // start progress bar
18
- to . meta && ( typeof to . meta . title !== 'undefined' && setDocumentTitle ( `${ to . meta . title } - ${ domTitle } ` ) )
19
+ to . meta && ( typeof to . meta . title !== 'undefined' && setDocumentTitle ( `${ i18nRender ( to . meta . title ) } - ${ domTitle } ` ) )
19
20
/* has token */
20
21
if ( storage . get ( ACCESS_TOKEN ) ) {
21
22
if ( to . path === loginRoutePath ) {
You can’t perform that action at this time.
0 commit comments