Use the elementui component library to introduce elementui as needed. Configure the error according to the code in the official document!!
Error: cannot find module ‘Babel plugin component’
fisrt install babel-plugin-component: npm install babel-plugin-component -D
vue/cli There is no.Babelrc file, but babel.config.js file. When importing on demand, you need to configure it in babel.config.js file
module.exports = { presets: [ '@vue/cli-plugin-babel/preset', ], plugins: [ [ "component", { "libraryName": "element-ui", "styleLibraryName": "theme-chalk" } ] ] };
Similar Posts:
- React uses antd to import error messages on demand
- [Solved] Vue installation Babel dependency error
- vue ‘Couldn’t find preset “es2015” relative to directory’
- [Solved] react Project Error: Support for the experimental syntax ‘decorators-legacy’ isn’t currently enabled
- Nuxt module build failed error report
- Cannot find module ‘@babel/core’ [How to Solve]
- [Solved] MODULE BUILD FAILED: ERROR: COULDN’T FIND PRESET “ES2015” RELATIVE TO DIRECTORY
- Support for the experimental syntax ‘classProperties’ isn’t currently enabled
- [Solved] app crashed – waiting for file changes before starting…
- webpack4 Cannot find module ‘@babel/core’ [Solved]