美文网首页
使用vue时,报错“exports is not defined

使用vue时,报错“exports is not defined

作者: 喜欢走弯路的人 | 来源:发表于2022-01-14 16:14 被阅读0次

使用vue时,报错“exports is not defined”

这是使用了CommonJs写法

而在应用中并没有做相应的模块转换使得浏览器能够识别

而导致这个问题是因为balbel的配置文件.babelrc的问题

所以,需要改动.babelrc文件即可:

修改.babelrc文件

如图所示,将"modules": false直接注释,或者删掉即可

相关文章

网友评论

      本文标题:使用vue时,报错“exports is not defined

      本文链接:https://www.haomeiwen.com/subject/amvxcrtx.html