使用vue-cli创建项目,使用less时,报错
Inline JavaScript is not enabled. Is it set in your options
在vue.config中配置:
css: {
loaderOptions: {
less: {
modifyVars: {
'primary-color': '#1DA57A',
'link-color': '#1DA57A',
'border-radius-base': '2px',
},
javascriptEnabled: true
}
}
}
然后报错:
Invalid options object. Less Loader has been initialized using an options object that does not match the API schema.
修改配置:
css: {
loaderOptions: {
less: {
lessOptions: {
modifyVars: {
'primary-color': '#1DA57A',
'link-color': '#1DA57A',
'border-radius-base': '2px',
},
javascriptEnabled: true
}
}
}
}
解决!
网友评论