47 lines
902 B
TypeScript
47 lines
902 B
TypeScript
import { createPinia } from 'pinia';
|
|
import { createApp } from 'vue';
|
|
import { createI18n } from 'vue-i18n';
|
|
import { createMemoryHistory, createRouter } from 'vue-router';
|
|
import App from './App.vue';
|
|
import HelloWorld from './components/HelloWorld.vue';
|
|
|
|
import Demo from './components/Demo.vue';
|
|
import './style.css';
|
|
const i18n = createI18n({
|
|
locale: 'zh',
|
|
fallbackLocale: 'en',
|
|
messages: {
|
|
en: {
|
|
message: {
|
|
hello: 'hello world',
|
|
},
|
|
},
|
|
zh: {
|
|
message: {
|
|
hello: '你好 世界',
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
const routes = [
|
|
{ path: '/', component: App },
|
|
{ path: '/about', component: HelloWorld },
|
|
{ path: '/demo', component: Demo },
|
|
];
|
|
|
|
const pinia = createPinia();
|
|
|
|
const router = createRouter({
|
|
history: createMemoryHistory(),
|
|
routes,
|
|
});
|
|
const app = createApp(App);
|
|
|
|
app.use(i18n);
|
|
|
|
app.use(router);
|
|
app.use(pinia);
|
|
|
|
app.mount('#app');
|