feat: Element Plus 最新版本国际化和集成i18n插件实现自定义国际化(包括动态路由)

This commit is contained in:
郝先瑞
2022-02-24 00:22:11 +08:00
parent 71cec7be32
commit 966bdf1b6e
10 changed files with 142 additions and 87 deletions

View File

@@ -5,8 +5,10 @@
>
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path)">
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
<svg-icon v-if="onlyOneChild.meta && onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
<template #title>{{ onlyOneChild.meta.title }}</template>
<svg-icon v-if="onlyOneChild.meta && onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"/>
<template #title>
{{ generateTitle(onlyOneChild.meta.title ) }}
</template>
</el-menu-item>
</app-link>
</template>
@@ -14,7 +16,7 @@
<!-- popper-append-to-body -->
<template #title>
<svg-icon v-if="item.meta && item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
<span v-if="item.meta && item.meta.title">{{ item.meta.title }}</span>
<span v-if="item.meta && item.meta.title">{{generateTitle(item.meta.title) }}</span>
</template>
<sidebar-item
@@ -32,12 +34,14 @@
<script setup lang="ts">
import path from 'path-browserify'
import {PropType, ref} from "vue";
import { ref} from "vue";
import {isExternal} from '@/utils/validate'
import AppLink from './Link.vue'
import SvgIcon from '@/components/SvgIcon/index.vue';
import {RouteRecordRaw} from "vue-router";
import SvgIcon from '@/components/SvgIcon/index.vue';
import { generateTitle } from '@/utils/i18n'
const props = defineProps({
item: {
type: Object,