其他分享
首页 > 其他分享> > @vue/cli element plus 自动导入

@vue/cli element plus 自动导入

作者:互联网

npm install -D unplugin-vue-components unplugin-auto-import
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = {
    configureWebpack: {
        plugins: [
          AutoImport({
            resolvers: [ElementPlusResolver()],
          }),
          Components({
            resolvers: [ElementPlusResolver()],
          }),
        ],
    },
}

 

标签:vue,const,cli,auto,element,unplugin,components,import
来源: https://www.cnblogs.com/bmbrother/p/15900144.html