error failed to extract(ERROR Failed to compile with 1 error)
WARNING Compiled with 1 warning 23:24:43
warning in ./src/main.jsexport default (imported as store) was not found in ./store (module has no exports)
出现这种报错是因为没有找相关导出store在src/stoer/index.js中加入导出 export default store 即可
import { createStore } from "vuex" //vuex 的核心作用就是帮我们管理组件之间的状态的 const store = createStore({ //所有的状态数据都放在这里(数据) state:{ counter:0 } }) export default store2.想要解决上图的问题 ,在.eslintrc.js文件中 ,添加红色框中的代码,就可以解决代码爆红的问题完整报错信息:Parsing error: No Babel config file detected for D:\VuecliWorkspace\vue_test\src\main.js. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files
里面写了使用requireConfigFile:false解决
解决方法: "requireConfigFile":false
3 ,Vue项目中出现error Component name "xxxx" should always be multi-word vue/multi-word-comp报错信息怎么办 ,直接添加这行代码就行 一 、前言 在我们写Vue项目的时候可能会报出这样一个错误:建议修改文
在我们的项目中找到vue.config.js文件 ,配置改文件 ,配置信息如下:
const { defineConfig } = require(@vue/cli-service) module.exports = defineConfig({ transpileDependencies: true, lintOnSave:false })一般有vue.config.js这个文件的只需要添加下面的一行代码就行
lintOnSave:false4.将这段代码中的this去掉 const handleLogin=()=>{
this.$store.commit("setCoun",100);
console.log(store.state.count);
}
5 ,
创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!