dash14 / v-network-graph

An interactive network graph visualization component for Vue 3
https://dash14.github.io/v-network-graph/
MIT License
495 stars 44 forks source link

Quasar boot file #28

Closed wanderernxa closed 2 years ago

wanderernxa commented 2 years ago

Hi, Do you have an example of how to configure the boot file when using Quasar? Normally, I would put this in the main.js file and everything works: import { createApp } from "vue"; import App from "./App.vue"; import router from "./router"; import store from "./store"; import VNetworkGraph from "v-network-graph"; import "v-network-graph/lib/style.css";

createApp(App).use(store).use(router).use(VNetworkGraph).mount("#app");

But you cannot do this in Quasar, you have to create seperate boot files for each one...I tried this but got an error saying failed to resolve component import { boot } from 'quasar/wrappers' import VNetworkGraph from "v-network-graph"; import "v-network-graph/lib/style.css";

// "async" is optional; // more info on params: https://v2.quasar.dev/quasar-cli/boot-files export default boot(({ app }) => { // something to do app.config.globalProperties.$VNetworkGraph = VNetworkGraph

})

thanks!

wanderernxa commented 2 years ago

ok, user error :) for others....using quasar...

  1. create a boot file running this from quasar cli --> quasar new boot networkgraph this will create a file called networkgraph.js under your src/boot folder in that file paste the following: import { boot } from 'quasar/wrappers' import VNetworkGraph from "v-network-graph"; import "v-network-graph/lib/style.css";

// "async" is optional; // more info on params: https://v2.quasar.dev/quasar-cli/boot-files export default boot(({ app }) => { // something to do app.use(VNetworkGraph) })

now you can run your graphs normally.

hope this helps.

thanks.