发现问题:安装完 ag-grid 然后打开项目发现报错!!!
解决办法:在vue.config.js里写
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
resolve: {
alias: {
'ag-grid-community/styles': path.resolve(
__dirname,
'node_modules/ag-grid-community/styles'
),
'ag-grid-community': path.resolve(
__dirname,
'node_modules/ag-grid-community/dist/ag-grid-community.cjs.js'
)
}
}
}
})
然后就不报错了,ok,搞定!!!