feat: 添加pinia

This commit is contained in:
王红彬
2024-09-06 16:29:15 +08:00
parent 868d1ffba4
commit 0abc33cee4
9 changed files with 86 additions and 7 deletions

View File

@@ -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');