antd less加载报错.bezierEasingMixin()解决

柔光的暖阳◎ 2023-10-11 15:34 96阅读 0赞

环境介绍

vue + ts + antd

  • package.json文件展示

    “dependencies”: {

    1. "@antv/data-set": "^0.11.1",
    2. "@antv/g2": "^4.0.0",
    3. "@antv/g2plot": "^0.11.33",
    4. "@types/mockjs": "^1.0.2",
    5. "@types/vue-ls": "^3.2.1",
    6. "ant-design-vue": "^1.4.11",
    7. "axios": "^0.19.2",
    8. "core-js": "^3.6.4",
    9. "less-loader": "^5.0.0",
    10. "mockjs": "^1.1.0",
    11. "nprogress": "^0.2.0",
    12. "viser-vue": "^2.4.8",
    13. "vue": "^2.6.11",
    14. "vue-class-component": "^7.2.2",
    15. "vue-cropper": "^0.5.0",
    16. "vue-ls": "^3.2.1",
    17. "vue-property-decorator": "^8.3.0",
    18. "vue-router": "^3.1.5",
    19. "vuex": "^3.1.2",
    20. "vuex-class": "^0.3.2"

    },
    “devDependencies”: {

    1. "@typescript-eslint/eslint-plugin": "^2.18.0",
    2. "@typescript-eslint/parser": "^2.18.0",
    3. "@vue/cli-plugin-babel": "~4.2.0",
    4. "@vue/cli-plugin-eslint": "~4.2.0",
    5. "@vue/cli-plugin-router": "~4.2.0",
    6. "@vue/cli-plugin-typescript": "~4.2.0",
    7. "@vue/cli-plugin-vuex": "~4.2.0",
    8. "@vue/cli-service": "~4.2.0",
    9. "@vue/eslint-config-standard": "^5.1.0",
    10. "@vue/eslint-config-typescript": "^5.0.1",
    11. "eslint": "^6.7.2",
    12. "eslint-plugin-import": "^2.20.1",
    13. "eslint-plugin-node": "^11.0.0",
    14. "eslint-plugin-promise": "^4.2.1",
    15. "eslint-plugin-standard": "^4.0.0",
    16. "eslint-plugin-vue": "^6.1.2",
    17. "less": "^3.0.4",
    18. "less-loader": "^5.0.0",
    19. "typescript": "~3.8.3",
    20. "vue-template-compiler": "^2.6.11"

    }

完整报错信息如下:

  1. // https://github.com/ant-design/ant-motion/issues/44
  2. .bezierEasingMixin();
  3. ^
  4. Inline JavaScript is not enabled. Is it set in your options?
  5. in F:\iBlockChain\iblockchain-client\node_modules\ant-design-vue\lib\style\color\bezierEasing.less (line 110, column 0)

解决方法

  • 在vue.config.js文件中添加以下配置:

    module.exports = {

    css: {

    1. loaderOptions: {
    2. less: {
    3. javascriptEnabled: true,
    4. }
    5. }

    }

至此,问题解决

发表评论

表情:
评论列表 (有 0 条评论,96人围观)

还没有评论,来说两句吧...

相关阅读