question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parsing Json config file in props of particles

See original GitHub issue

/* DO NOT DELETE THE TEMPLATE BELOW, you can safely delete this line */

Which version are you using? Ex. 1.18.11

Is the latest version affected?

  • Yes
  • No

Which library are you using?

  • Vue.js 2.x (particles.vue)

Is there a way by which I can parse the json config that I got from the website and inject it into the props of the Particles component? because I does not seem to work when I copy the configuration in the showcase in codepen, I want to know how to load the json from the website and use it in my vue components.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Yael95commented, Nov 19, 2020

Thank you for your help I got the polygon forest to work, thank you for your help and patience.

0reactions
matteobrunicommented, Nov 19, 2020

I’ve updated the CodeSandbox sample linked in the previous message. I’ve added some comments but I’ll explain here too:

The file App.vue uses the Particles component but its initialization is made in the main.js file.

/* the import of the Particles.vue plugin */
import Particles from "particles.vue";
/* the import of the polyfill library needed for the polygon mask */
import "pathseg";

/* adds the Particles.vue plugin to the Vue instance, this enables the component */
Vue.use(Particles);

This is the code needed to make particles.vue work correctly. The import "pathseg"; is needed only for polygonMask configurations since some browsers have removed the SVG 1.1 compatibility (Chrome for example).

If you are using some SSR framework you need to import both particles.vue and pathseg client-side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Symfony 3, add a json config file needed by a javascript script ...
js script needs to read a json config file named "particles.json" (also located in /var/www/mywebsite/wev/library ). How can I add this json ......
Read more >
rickkas7/JsonParserGeneratorRK: JSON parser and ... - GitHub
JSON parser and generator for Particle devices. ... If you have a complicated JSON file to decode, using the JSON Parser Tool makes...
Read more >
Particles.js: Introduction - Code
path-json is the path to the JSON file with all the configuration options, and callback is an optional callback function. Instead of a...
Read more >
Parse JSON config files with Groovy - Opensource.com
In this article, I'll sidestep the debate about whether or not to use JSON as a configuration file format and explain how to...
Read more >
How to Use Particles.js in React Project ? - GeeksforGeeks
1. Installation Process: Run the following command on terminal to install Particles. · 2. Import the packages: Import the package in your file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found