chore: modify the i18n implementation logic of PageLayout component 🌟

This commit is contained in:
iczer
2020-06-30 16:16:34 +08:00
parent 163b9e1b5f
commit 112f862988
5 changed files with 63 additions and 56 deletions

View File

@@ -3,7 +3,7 @@
* menuOptions示例
* [
* {
* title: '菜单标题',
* name: '菜单名称',
* path: '菜单路由',
* meta: {
* icon: '菜单图标',
@@ -12,7 +12,7 @@
* children: [子菜单配置]
* },
* {
* title: '菜单标题',
* name: '菜单名称',
* path: '菜单路由',
* meta: {
* icon: '菜单图标',
@@ -37,8 +37,6 @@ const {Item, SubMenu} = Menu
export default {
name: 'IMenu',
i18n: {
},
props: {
options: {
type: Array,

View File

@@ -3,9 +3,8 @@
<div :class="['page-header-wide', layout]">
<div class="breadcrumb">
<a-breadcrumb>
<a-breadcrumb-item :key="item.path" v-for="(item, index) in breadcrumb">
<span v-if="index === 0"><a href="#/dashboard/workplace">{{$t('home.name')}}</a></span>
<span v-else>{{$t(item.path.substring(1).replace(new RegExp('/', 'g'), '.') + '.name')}}</span>
<a-breadcrumb-item :key="index" v-for="(item, index) in breadcrumb">
<span>{{item}}</span>
</a-breadcrumb-item>
</a-breadcrumb>
</div>
@@ -48,13 +47,6 @@ export default {
type: String,
required: false
},
i18n: Object
},
created() {
let i18n = this.i18n
Object.keys(i18n).forEach(key => {
this.$i18n.mergeLocaleMessage(key, i18n[key])
})
},
computed: {
layout () {