You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
41 lines
1.1 KiB
5 months ago
|
import { onMounted } from 'vue';
|
||
|
import { defineClientConfig } from 'vuepress/client';
|
||
|
import 'platform-core/dist/css/platform-core.css';
|
||
|
|
||
|
export default defineClientConfig({
|
||
|
async enhance({ app, router, siteData }) {
|
||
|
if (!__VUEPRESS_SSR__) {
|
||
|
// 在浏览器 window 对象中新建名为 APP 的容器变量, 用于存放平台的全局变量
|
||
|
window.APP = {
|
||
|
configure: {
|
||
|
webContextPath: '/',
|
||
|
apiContextPaths: {
|
||
|
DEFAULT: 'http://localhost:8080/',
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
|
||
|
// 初始化 platform
|
||
|
const platform = await import('platform-core');
|
||
|
platform.installForVuePress(app);
|
||
|
|
||
|
// 初始化 vue-i18n
|
||
|
const vueI18n = await import('vue-i18n');
|
||
|
const i18n = vueI18n.createI18n({
|
||
|
legacy: false,
|
||
|
availableLocales: ['en', 'zh_CN', 'tw_CN'],
|
||
|
locale: 'zh_CN',
|
||
|
fallbackLocale: 'en',
|
||
|
missingWarn: false,
|
||
|
fallbackWarn: false,
|
||
|
});
|
||
|
app.use(i18n);
|
||
|
}
|
||
|
},
|
||
|
setup() {
|
||
|
onMounted(() => {
|
||
|
document.querySelector('#app');
|
||
|
});
|
||
|
},
|
||
|
});
|