自定义组件中引入element-ui/packages/scrollbar 报错

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     }, this.$slots.default);
|     const wrap = (
>       <div
|         ref="wrap"
|         style={ style }

解决方法
在vue.config.js中module.exports添加

    transpileDependencies: [
        'element-ui/packages/scrollbar'
    ],

猜你喜欢

转载自blog.csdn.net/cuiyuchen111/article/details/131384573