提交 3fb53ccb 编写于 作者: Cano1997's avatar Cano1997

update: 多语言优化

上级 2019ebd5
......@@ -22,8 +22,8 @@
</template>
<template v-if="!Object.is(this.navModel,'route')">
<el-breadcrumb-item v-for="(item, index) in breadcrumbs" :key="item.path">
<span v-if="index === breadcrumbs.length-1" class="no-redirect" >{{ $t(item.meta.caption)}}</span>
<a v-else @click.prevent="handleLink(item)" >{{ $t(item.meta.caption) }}</a>
<span v-if="index === breadcrumbs.length-1" class="no-redirect" >{{ getCaption(item.meta)}}</span>
<a v-else @click.prevent="handleLink(item)" >{{ getCaption(item.meta) }}</a>
</el-breadcrumb-item>
</template>
</transition-group>
......@@ -113,6 +113,18 @@ export default class Breadcrumb extends Vue {
}
}
/**
* 获取项标题
*
* @memberof Breadcrumb
*/
public getCaption(meta: any): any {
const caption = meta.captionLanResTag ? this.$t(meta.captionLanResTag, meta.caption) : meta.caption;
return meta.info && !Object.is(meta.info, "")
? `${this.$t(caption)} - ${this.$t(meta.info)}`
: this.$t(caption);
}
/**
* 获取面包屑数据
*
......
......@@ -8,7 +8,7 @@
:filterable="filterable"
@on-open-change="onClick"
:placeholder="placeholder?placeholder:$t('components.dropDownListDynamic.placeholder')">
<i-option v-for="(item, index) in items" :key="index" :class="item.class" :value="item.value">{{($t('userCustom.'+tag+'.'+item.value)!== ('userCustom.'+tag+'.'+item.value))?$t('userCustom.'+tag+'.'+item.value) : item.text}}</i-option>
<i-option v-for="(item, index) in items" :key="index" :class="item.class" :value="item.value">{{item.text}}</i-option>
</i-select>
</template>
......
......@@ -69,8 +69,8 @@ export default class TabPageExp extends Vue {
public getCaption(meta: any): any {
const caption = meta.captionLanResTag ? this.$t(meta.captionLanResTag, meta.caption) : meta.caption;
return meta.info && !Object.is(meta.info, "")
? `${this.$t(caption)} - ${this.$t(meta.info)}`
: this.$t(caption);
? `${caption} - ${meta.info}`
: caption;
}
/**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册