修改前,调试工具里面没有Pinia模块
在项目的入口文件mian.js中这样修改
import '@/assets/main.scss'
import pinia from '@/stores/index'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import elFormRenderer from 'el-form-renderer-vue3'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// const app = createApp(App)
// app.use(elFormRenderer)
// app.use(ElementPlus)
// app.use(pinia)
// app.use(router)
// app.mount('#app')
// 修改为
createApp(App)
.use(pinia)
.use(elFormRenderer)
.use(router)
.use(ElementPlus)
.mount('#app')
加载过一次 不这样写也没关系了