# 使用

# ie兼容

# vue-cli 4.x

# 安装依赖
yarn add @babel/plugin-transform-runtime
yarn add @babel/runtime
yarn add @babel/runtime-corejs3

# 修改babel.config.js
module.exports = {
  presets: [
    '@vue/cli-plugin-babel/preset'
  ],
  plugins: [
    [
      '@babel/plugin-transform-runtime',
      {
        corejs: 3,
        helpers: true,
        regenerator: true,
        useESModules: false
      }
    ]
  ]
}

# 修改vue.config.js
module.exports = {
  transpileDependencies: [
    'ant-design-vue',
  ]
}

# vue-cli 其他版本

# 安装
yarn add jquery

# jquery

# 安装
yarn add jquery

# vue.config.js配置
const webpack = require('webpack')
configureWebpack: {
  plugins: [
    new webpack.ProvidePlugin({
      $: 'jquery',
      jQuery: 'jquery',
      'windows.jQuery': 'jquery'
    })
  ]
}

# package.json配置
"eslintConfig": {
  "root": true,
  "env": {
    "node": true,
    "jquery": true
    },
  "extends": [
    "plugin:vue/essential",
    "@vue/standard"
  ],
  "parserOptions": {
    "parser": "babel-eslint"
  },
  "rules": {}
}
上次更新: 2021/6/15 下午4:48:59