Comments (6)
Use the App Configuration file to specify your dependencies. You are interested in deps
property.
-
First npm install the Vue Components dependecies.
-
Configure
quasar.build.yml
:
Example forvue-google-maps
(not the whole file, just what you are interested in):deps: js: [ 'node_modules/q/q.js', 'node_modules/lodash/index.js', 'node_modules/vue-google-maps/index.js' ]
As dependency string needed for
quasar.build.yml
, look into the node_modules folder of your installed component and check for themain
entry point (usually in adist
folder). You can read the component'spackage.json
for this property. -
Use your Vue Component:
Generally speaking, look at
standalone usage
for the Vue Components you want to use. Invue-google-maps
case, you should declare the components yourself before using them. Here is an extract from their website:// they inject VueGoogleMap global: VueGoogleMap.load({ 'key': 'YOUR_API_KEY', }); Vue.component('google-map', VueGoogleMap.Map);
You have three options for including the declarations above.
A) You can include these declarations in
src/index.html
insidequasar.boot()
:quasar.boot(function() { VueGoogleMap.load({ 'key': 'YOUR_API_KEY', }); Vue.component('google-map', VueGoogleMap.Map); quasar.start.app(); });
B) ... or you can make a JS file like
src/js/app.js
and require it fromsrc/index.html
. Read about the Quasar Starting Point.C) Include the declarations in a Page script file (script.page-name.js) before
module.exports
if you are using the Component just for that Page.
Will also add a page for this on the documentation website.
Please reopen if you encounter problems.
from quasar.
This raises some issues:
- Do I have to install these 3 unmet deps?
- If I force install these 3 deps (including vue, which is weird considering quasar already included vue and I cannot run VueGoogleMap if I don't include vue) and use require('VueGoogleMap'), the autorefresher took much longer to process (up to 2 mins).
- Also the deps.js's footprint increases by 2mb, which I believe this should be much lower
from quasar.
Just include lodash and Q. Vue is supplied by default, so you can ignore the warning (or npm install it to avoid the warning, but do not add it in quasar.build.yml
).
Do not require('VueGoogleMap')
. Simply use the global that vue-google-maps injects: VueGoogleMap
, like this:
VueGoogleMap.load({
'key': 'YOUR_API_KEY',
});
Vue.component('google-map', VueGoogleMap.Map);
// also declare the other components that you want to use from vue-google-maps
Please note that development builds include sourcemaps.
from quasar.
And when I say "include lodash and Q" I mean "npm install" them and add them to quasar.build.yml
.
from quasar.
I tried to include vue-google-maps from quasar.build.yml then got this error:
Uncaught ReferenceError: require is not defined
turns out vue-google-maps wasn't included / exported, but I can use Q and _
from quasar.
Tried an example myself and got same error. Opened a bug for vue-google-maps:
GuillaumeLeclerc/vue-google-maps#81
The map seems to be working though, even if I got that error.
from quasar.
Related Issues (20)
- Wrong link in rules full list
- How to use `Dialog Plugin` to implement asynchronous commit operations? HOT 2
- How to use `Dialog Plugin` to implement asynchronous commit operations? HOT 2
- Flickering screen when resizing window
- bex build broken due to 'Could not resolve "quasar/src/utils/uid"' HOT 6
- @quasar/app-vite relies on vulnerable package html-minifier HOT 4
- unplugin-auto-import no longer working HOT 1
- Quasar CLI fails to open Android Studio from WSL Environment HOT 2
- q-tooltip component is actually using wrong font-size style. HOT 1
- Quasar build fails with latest cordova-ios HOT 7
- Chat-Message does not render buttons
- Quasar Not Starting After Installation Of Apollo AE HOT 4
- Missing Labels for QTable Pagination Buttons
- Problems with using Q-table Component
- Q-img high Recalc per sec when the image hasn't been in the viewport HOT 2
- q-editor - paragraph-tag property has no effect
- Quasar Electron can't build with Electron Builder versions 24.13.1 and higher (the default that Quasar pulls) using pnpm
- QInput `shadow-text` is showing when input is out of focus but `hasError` is true
- npm install error: node-waf: command not found (due to zlib dependency) HOT 1
- QEditor - Plaintext pasting example editorRef.value.runCmd() - Not found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quasar.