使用 ant-design-vue时,错误信息
ERROR Failed to compile with 1 error
error in ./node_modules/ant-design-vue/dist/antd.less
Syntax Error:
// https://github.com/ant-design/ant-motion/issues/44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
解决方法
less-load版本低于6.0时:vue.config.js 配置
module.exports = defineConfig({
transpileDependencies: true,
css: {
loaderOptions: {
less: {
javascriptEnabled: true
}
}
}
})
less-load版本高于6.0时:vue.config.js 配置
module.exports = defineConfig({
transpileDependencies: true,
css: {
loaderOptions: {
less: {
lessOptions: {
javascriptEnabled: true
}
}
}
}
})
本文介绍了解决使用ant-design-vue时遇到的less语法错误的具体步骤。针对不同版本的less-loader提供了两种不同的vue.config.js配置方法,确保正确加载JavaScript代码。
5469

被折叠的 条评论
为什么被折叠?



