随手记,vue2项目遇到的问题

2024-08-21  本文已影响0人  hsqin

vue2后台管理项目遇到的问题汇总
1,提示定义了参数,但是从未使用过
vscode 'params' is defined but never used no-unused-vars vscode

网上很多都说要在项目根目录的 ·.eslintrc.js·里面的rules里面添加 'no-unused-vars': 'off',但是我的项目里面根本没有这个js文件。
后查看其它资料,最后在package.json里面配置的


image.png

2,We're sorry but 项目名 doesn't work properly without JavaScript enabled. Please enable it to continue.
这个忘记了,好像是某个地方写错了。

3,调用post接口,提示Required request body is missing:

原因:写了参数,没有传递过去,最后一个params忘记写了
UserLoginApi = (params) => instance.post('/manage/login',params)

4,使用vuex的时候提示

无法找到模块“vuex”的声明文件。“/node_modules/vuex/dist/vuex.mjs”隐式拥有 "any" 类型。   There are types at '/node_modules/vuex/types/index.d.ts', but this result could not be reso

网上很多是ts或者vite开发出现的,但是我的项目是vue2+js,
找了很多个文章,才发现这样解决:


jie'j.png
上一篇下一篇

猜你喜欢

热点阅读