ERROR Failed to compile with 1 error
WARNING Compiled with 1 warning 23:24:43
warning in ./src/main.js
export '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 store
2.想要解决上图的问题,在.eslintrc.js文件中,添加红色框中的代码,就可以解决代码爆红的问题完整报错信息:Parsing error: No Babel config file detected for D:VuecliWorkspacevue_testsrcmain.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:false
4.将这段代码中的this去掉 const handleLogin=()=>{
this.$store.commit("setCoun",100);
console.log(store.state.count);
}
5,
相关文章
- 在 Ubuntu 20.04 Linux 上启用 SSH 的正确姿势
- 面试官,您确定要让我展开讲进程吗?
- 聊聊Linux 内核入口分析
- 谷歌 Chrome 浏览器安卓版测试支持默认打开桌面版网站
- HTTPS Everywhere 浏览器扩展即将功成身退
- 2021 年了,我们能推荐使用 Linux 来玩游戏吗?
- Windows 11改进了硬盘空间占用和性能表现
- 如何在 Linux 上优雅的玩 Windows 游戏
- Google 将逐步取消 Chrome 对 Manifest V2 扩展的支持
- Facebook 持续研究 BOLT 来提升 Linux 内核性能
- Chrome 开始测试三位数用户代理,以检查网站兼容性
- 用 Lima 在你的 Mac 上运行容器
- 微软Edge 94正式版可在浏览器中开启悬浮滚动条,无需繁琐指令
- 谷歌 Chrome 浏览器将于 2023 年彻底抛弃扩展程序旧规范
- 微软 Edge 浏览器 v94 正式版发布:提高安全性,修复 MHTML 问题
- Windows 10 预览版用户收到 Windows 11 升级提示,可选择继续接收 21H2 更新
- 鼠标光标颜色也可以改变了,在Windows 11中是这样实现的
- Chrome正测试“Side Search”功能:可在侧边栏显示关键词搜索结果
- GNOME 41 发布:受欢迎的Linux 桌面环境的精细打磨
- Linux技能不再是第一需求?Linux基金会发布2021开源工作报告:云容器市场需求最高