本来应该是一个很简单的事情,但是不知道怎么弄了这么半天。
下面说一下,使用插件的方式使用vue-particles
第一步:安装
npm i vue-particles
第二步:在plugins下面创建 vue-particles.js

import Vue from 'vue'
import VueParticles from 'vue-particles'
export default () => {
Vue.use(VueParticles)
}
第三步:配置nuxt.config.js

{ src:"~plugins/vue-particles",ssr:false},
第四步:使用

