runtime-core.esm-bundler.js?d2dd:40 [Vue warn]: Property "$store" was accessed during render but is not defined on instance. at <App>
时间: 2023-11-18 15:00:30 浏览: 51
This warning occurs when you are trying to access the "$store" property of the root Vue instance during rendering, but the property is not defined.
To fix this issue, you need to make sure that the "$store" property is properly injected into the root Vue instance. This can be done by using the "store" option when creating the Vue instance:
```
import { createApp } from 'vue'
import App from './App.vue'
import store from './store'
const app = createApp(App)
app.use(store)
app.mount('#app')
```
In this example, we import the Vuex store from "./store" and then use the "store" option to inject it into the root Vue instance. This makes the "$store" property available in all components, including during rendering.
阅读全文