bug解决
程序媛小y
一枚前端程序媛
展开
-
vitest测试 element-plus二次封装组件时css文件报错
报错内容: Unknown file extension “.css” for D:\demo\omniButton\node_modules.pnpm\registry.npmmirror.com+element-plus@2.2.9_vue@3.2.37\node_modules\element-plus\theme-chalk\el-button.css。重启生效,vitest 会 hmr,如果未生效,请重启。原创 2023-06-22 23:58:48 · 2172 阅读 · 0 评论 -
使用TS+vue3封装axios时编译报错,提示You may need an additional loader to handle the result of these loaders.
基于vue3+TS构建的商城后台管理系统根据coderwhy老师指导搭建的项目为PC端商品后台管理系统。报错:使用TS+vue3封装axios时编译报错,提示You may need an additional loader to handle the result of these loaders.今天自己在做vue3+TS+cms的coderwhy老师的项目时,在项目起步,对axios进行封装时,部分封装代码如下npm run serve 一直报错,报错信息如下:自己在Google上搜了好久,都原创 2022-06-24 13:15:45 · 2960 阅读 · 5 评论 -
【vue3项目】解决 “TypeError: Cannot read properties of undefined (reading ‘xxx‘)“
定义一个 getUserList 函数,并且在 onMounted 函数中挂载它,在加载页面时,先通过我自定义的已全局挂载的。结果发现:ctx.$api 为 undefined,并且 ctx 身上并没有我们绑定的 $api。首先这个报错的意思大概是:无法找到 undefined 的 属性。所以就验证了bug 的原因是:vue3的全局绑定没有生效。逻辑上没有问题,同时也没有出现上述的三种情况。所以,我猜测是 $api 全局绑定没有生效。但是上述方法都无法解决我的bug,那在我的代码中的意思就是:找不到。...原创 2022-08-12 12:09:14 · 43857 阅读 · 0 评论 -
【解决ESlint的bug】return old(m, filename); Error [ERR_REQUIRE_ESM]: require() of ES Module
将根目录下的 `commitlint.config.js`文件后缀名改为 cjs,即 commitlint.config.cjs 文件。原创 2022-09-25 18:18:20 · 2201 阅读 · 0 评论
分享