修改配置文件一定要重启!
    控制台报错
    image.png
    修改webpack.base.conf.js文件
    image.png

    1. {
    2. test: /\.css$/,
    3. use: [
    4. // MiniCssExtractPlugin.loader,
    5. {
    6. loader: 'css-loader!style-loader',
    7. options: {
    8. importLoaders: 2,
    9. },
    10. },
    11. 'postcss-loader',
    12. ],
    13. exclude: /node_modules/
    14. },

    main.js文件
    加:import ‘element-ui/lib/theme-chalk/index.css’

    1. import Vue from 'vue'
    2. import App from './App'
    3. import router from './router'
    4. import ElementUI from 'element-ui';
    5. import 'element-ui/lib/theme-chalk/index.css'
    6. Vue.use(ElementUI);
    7. Vue.config.productionTip = false
    8. /* eslint-disable no-new */
    9. new Vue({
    10. el: '#app',
    11. router,
    12. components: { App },
    13. template: '<App/>'
    14. })