当前位置:网站首页>export ‘createStore‘ (imported as ‘createStore‘) was not found in ‘./ store/index. js‘ (possible expor
export ‘createStore‘ (imported as ‘createStore‘) was not found in ‘./ store/index. js‘ (possible expor
2022-04-22 03:40:00 【m0_ forty-nine million four hundred and seventy-one thousand si】
Catalog
Report errors :
export 'createStore' (imported as 'createStore') was not found in './store/index.js' (possible exports: default)
Source code :
store in index.js
import {createStore} from 'vuex'
import app from './modules/app'
import user from './modules/user'
import getters from './getters'
import state from './state'
import mutations from './mutations'
export default createStore({
modules: {
app,
user
},
getters,
state,
mutations
})
main.js Global mount error
import {createStore} from './store/index.js'
app.use(createStore)
Modified code :
import {createStore} from 'vuex'
import app from './modules/app'
import user from './modules/user'
import getters from './getters'
import state from './state'
import mutations from './mutations'
const store = createStore({
modules: {
app,
user
},
getters,
state,
mutations
})
export default store;
main.js
import store from './store/index.js'
app.use(store)
Use... In components
import { useStore } from "vuex"
setup(){
const store = useStore()
console.log(store)
}
Successfully printed , No longer an error

版权声明
本文为[m0_ forty-nine million four hundred and seventy-one thousand si]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220340046727.html
边栏推荐
- Use js to obtain web page data and format it for output (web page crawling)
- Implementation of small cases
- GPU深度学习环境配置
- What is the future direction of GPU?
- ECMAScript 6 -- Deconstruction and assignment of variables
- College English vocabulary analysis Chinese University MOOC Huazhong University of science and technology
- Oracle architecture
- VOS3000 8.05安装及源码
- AI video cloud vs narrowband HD, who is the darling of the video era
- Terminate thread using interrupt
猜你喜欢

php. Ini configuration

DO447Ansible Tower导航

What is the future direction of GPU?

Smart Life - how convenient is it to schedule smart home devices?

2022-04-21: given a blacklist containing non repeating integers in [0, n), write a function to return a random integer not in the blacklist from [0, n), and optimize it to minimize the number of calls

Analysis of JMeter pressure measurement mqtt results

Let others connect to their own MySQL database and share the MySQL database

Pycharm jumps to the specified line

Baidu offline map research and development -- laravel framework

Oracle 11g enterprise installation tutorial
随机推荐
php.ini配置
Detailed explanation of double pointers of ring linked list 1 and 2
ForkJoin
Bubble ranking and running for president
吉他樂理整理
Full summary of 18 tax categories of tax law with memory tips
linux安装MySQL
Une solution pour enregistrer l'échec de la connexion à distance MySQL dans la configuration du serveur Cloud
記一次雲服務器配置mysql 遠程連接失敗的解决方案
TP5 uses phpoffice / phpexcel package to operate excel (export)
Take a look at this guide when the Hackathon competition is going on
Five methods of not displaying line number in history command in UNIX like system
Socket to do a simple network sniffer
"Select command denied to user 'nature' @ '192.168.1.49' for table 'user_variables_by_thread" is solved in MySQL‘“
Record the solution to the failure of configuring MySQL remote connection for ECS once
Restoring MySQL database based on data folder
Zabbix5 series - making topology map (XIII)
查看应用程序内存使用情况
Single example of multithreading
Zabbix5 series - monitor Huawei and H3C switches (snmpv2c / SNMPv3 / snmptrap) (II)