feat: 新增模块首页、国际化适配与菜单重载功能
1. 为菜单数据新增remark字段并设置默认值 2. 全量替换硬编码文本为国际化多语言支持 3. 新增生产配置模块首页组件与路由 4. 新增菜单重载action,支持语言切换后重载菜单 5. 补充简体中文、英文、日文、繁体中文语言包
This commit is contained in:
@@ -2,19 +2,20 @@ export default {
|
||||
methods: {
|
||||
onChangeLocale (command) {
|
||||
this.$i18n.locale = command
|
||||
let message = `当前语言:${this.$t('_name')} [ ${this.$i18n.locale} ]`
|
||||
let message = this.$t('page.layout.locales.changed', { name: this.$t('_name'), locale: this.$i18n.locale })
|
||||
if (process.env.VUE_APP_BUILD_MODE === 'PREVIEW') {
|
||||
message = [
|
||||
`当前语言:${this.$t('_name')} [ ${this.$i18n.locale} ]`,
|
||||
'仅提供切换功能,没有配置具体的语言数据 ',
|
||||
'文档参考:<a class="el-link el-link--primary is-underline" target="_blank" href="https://d2.pub/doc/d2-admin/locales">《国际化 | D2Admin》</a>'
|
||||
this.$t('page.layout.locales.changed', { name: this.$t('_name'), locale: this.$i18n.locale }),
|
||||
this.$t('page.layout.locales.preview_warning'),
|
||||
this.$t('page.layout.locales.preview_doc')
|
||||
].join('<br/>')
|
||||
}
|
||||
this.$notify({
|
||||
title: '语言变更',
|
||||
title: this.$t('page.layout.locales.notification_title'),
|
||||
dangerouslyUseHTMLString: true,
|
||||
message
|
||||
})
|
||||
this.$store.dispatch('d2admin/menu/menuReload')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user