Antd-vue兼容ie

555 阅读1分钟

在babel.config.js中加入以下的代码

module.exports = {
  presets: [
        '@vue/app',
        // 兼容配置
            [
                '@babel/preset-env',
                  {
                    corejs: { version: 3, proposals: true },
                    useBuiltIns: 'entry',
                  },
            ],
           ],
           plugins: [
            [
              'import',
              { libraryName: 'ant-design-vue', libraryDirectory: 'es', style: 'css' },
            ],
            ['@babel/plugin-transform-runtime'],
           ],
};

然后下载cors包

npm i cors

最后在main.js中加入

import 'core-js/stable';

完成