开发问题记录

321 阅读1分钟

vscode 没有校验代码

  • 在 vscode 关于 eslint 配置都 OK 的情况下,编辑器上的代码仍然没有eslint的波浪线提示,但是每个文件的首行代码的首个单词都出现黄色的波浪线,提示:

    ESLint is disabled since its execution has not been approved or denied yet. Use the light bulb menu to open the approval dialog.

    根据提示信息原来是 vscode 窗口右下角的 eslint 校验没有开启:

    image.png

    点击弹出对话框,选择 Allow Everywhere 即可。

Vue项目运行报错

  • 安装的 sass-loader 版本高导致报错

    image.png

    解决方法:卸载重新安装低版本的

  • 引入 ts 的vue3项目,引入vue-router 和 vuex使ts提示:

    Cannot find module 'vue-router' or its corresponding type declarations.ts(2307)

    解决方法:在tsconfig.js中去掉 vue-cli自动配置的

typescript

  • 引入图片资源时,提示找不到对应的模块

    // image.d.ts
    declare module '*.svg'
    declare module '*.png'
    declare module '*.jpg'