Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any docs on how to implement in Nuxt v2+? #47

Open
donPuerto opened this issue Nov 21, 2018 · 1 comment
Open

Any docs on how to implement in Nuxt v2+? #47

donPuerto opened this issue Nov 21, 2018 · 1 comment

Comments

@donPuerto
Copy link

Im having hard to play any documentation?

@S0PEX
Copy link

S0PEX commented Jan 11, 2019

Hey, unfortunately there now docs available but its very easy to implement.
First, you add this component using your favorite package manager.
I tend to use yarn so I ran yarn add vue-particles --dev.
Then you need to create a file under projectroot/plugins I called mine vue-particles.js and it looks like this

import Vue from 'vue'
import VueParticles from 'vue-particles'

export default () => {
  Vue.use(VueParticles)
}

After that you need to register the plugin, it is important to turn off SSR for this component since it isn't compatible with it for me.
So go inside nuxt.config.js and register the plugin. This is how my one looks like:

/*
  ** Plugins to load before mounting the App
  */
  plugins: [
    '@/plugins/element-ui',
    {
      src: '@/plugins/vue-particles',
      ssr: false
    }
  ],

Then u can use it like any other component in your pages.
Example:

<template>
  <div id="app">
    <vue-particles
      color="#dedede"
      :particleOpacity="0.7"
      :particlesNumber="80"
      shapeType="circle"
      :particleSize="4"
      linesColor="#dedede"
      :linesWidth="1"
      :lineLinked="true"
      :lineOpacity="0.4"
      :linesDistance="150"
      :moveSpeed="3"
      :hoverEffect="true"
      hoverMode="grab"
      :clickEffect="true"
      clickMode="push"
    >
    </vue-particles>
    <nuxt/>
  </div>
</template>

Regards Artur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants