VincentGarreau / particles.js

A lightweight JavaScript library for creating particles
https://vincentgarreau.com/particles.js/
MIT License
28.94k stars 4.82k forks source link

Single Page Application Errror 'pJS_tag is null' #475

Open kalenmike opened 3 years ago

kalenmike commented 3 years ago

I have a Vue application and everything loads fine, but when the router view changes I am getting an error:

Uncaught TypeError: pJS_tag is null

This is because the 'id=particle-js' element is not present on all views. Is there someway to unload the library? Or another way I can remove this error?

I am initialising the library like this:

window.particlesJS.load("particles-js", "/static/particles.json");