feat: 帮助文档多语言文件上传
This commit is contained in:
@@ -3,11 +3,24 @@ import useAppStore from '@/store/modules/app';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
const { t } = useI18n();
|
||||
import { computed } from 'vue';
|
||||
const { t, currentLocale } = useI18n();
|
||||
const appStore = useAppStore();
|
||||
const route = useRoute();
|
||||
const docUrl = appStore.getHelpDoc;
|
||||
const height = ref<string>(document.documentElement.clientHeight + 'px');
|
||||
|
||||
// 文档地址
|
||||
const docUrl = computed(() => {
|
||||
let url = appStore.getHelpDoc;
|
||||
if (url.indexOf('{language}') === -1) {
|
||||
return url;
|
||||
}
|
||||
// 语言参数替换
|
||||
const local = (route.query.language as string) ?? currentLocale.value;
|
||||
const lang = local.split('_')[0];
|
||||
return url.replace('{language}', lang);
|
||||
});
|
||||
|
||||
/**
|
||||
* 国际化翻译转换
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user