这是由于vue-particles是使用es6语法写的,直接是不能使用的,所以需要在webpack.base.conf.js
文件中添加下面这段话
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test'), resolve('node_modules/vue-particles')]
}
如果是使用cnpm安装的话,需要给上面的修改一下,如下
resolve('node_modules/_vue-particles')
参考自:https://github.com/creotip/vue-particles/issues/7
如果觉得我的文章对您有用,请您随意打赏。您的支持将鼓励我更加努力创作!
如无特殊声明,文章均为原创,若有不正之处,万望告知。转载请附上原文地址,十分感谢!