feat: 添加pinia
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
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',
|
||||
@@ -24,8 +27,11 @@ const i18n = createI18n({
|
||||
const routes = [
|
||||
{ path: '/', component: App },
|
||||
{ path: '/about', component: HelloWorld },
|
||||
{ path: '/demo', component: Demo },
|
||||
];
|
||||
|
||||
const pinia = createPinia();
|
||||
|
||||
const router = createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes,
|
||||
@@ -35,5 +41,6 @@ const app = createApp(App);
|
||||
app.use(i18n);
|
||||
|
||||
app.use(router);
|
||||
app.use(pinia);
|
||||
|
||||
app.mount('#app');
|
||||
|
||||
Reference in New Issue
Block a user