- 项目出现error Unexpected ‘debugger‘ statement no-debugger。
解决办法:在package.json中的eslintConfig的rules下面添加以下代码:
// 关闭debugger和console报错
'no-debugger': 'off',
'no- console': 'off',
参考文章:Vue项目出现error Unexpected ‘debugger‘ statement no-debugger
2、VUE–MODULE PARSE FAILED: UNEXPECTED CHARACTER ‘’ (1:0) (FONTS/ELEMENT-ICONS.TTF) 引进新的字体报错。
{
test: /\.(woff|TTF|eot|svg)/,
loader: "file-loader?name=font/[name].[ext]"
}
参考文章:https://blog.csdn.net/GISuuser/article/details/114007849
3、vue项目中对本地json文件进行调用:
在public文件夹下建js文件夹:
例:
axios({
url: "/js/postsList.json",
method: "get",
}).then((res) => {
console.log(res);
});