-
Notifications
You must be signed in to change notification settings - Fork 73
i couldn't use the component directly on browser. #24
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
Comments
@lapcchan could you provide a sample? you could use https://codesandbox.io or smth like this |
I had the exact same problem. The issue stems from this line in the docs:
This is an invalid url and the library won't load. I tried doing this but it didn't load properly (maybe something on github?)
I then copied the js file into my /public/javascripts directory and it worked well.
So the fix for this would probably be to adjust the docs. An even better solution would be to have the library hosted on cdnjs or similar CDN. For what it's worth, we're developing a complex app using micro-front-end architecture patterns and do not use the CLI. Having standalone browser deployment is a HUGE part of why we chose vue.js over Angular or other alternatives. Thanks to the authors for supporting this method to load this great library. |
HI! @lapcchan Here is working usage example https://codesandbox.io/embed/v3qorzrxm7. The problem might be was in order of including files. You have to include the plugin first and then Vue.js. @graham-sportsmgmt plugin is hosted on unpkg.com https://unpkg.com/vue-google-charts@latest/dist/vue-google-charts.browser.js and you also can use shorter link like this: https://unpkg.com/vue-google-charts@latest |
Pull request created: I just edited the existing order, which was vue.js THEN the plugin. I didn't need to load the plugin before vue.js to get it to work, but I'm also including script links in the head and calling Vue in window.onload. |
For anyone else not able to make this work, here is sample code that works for me standalone in the browser (Probably some of this should go to the documentation too): HTML:
JS:
|
I still face the problem against the chartOption. I used the above link but it didn't help. The code given here is fine but still, the display present does not show the Options. |
got this error:
[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.
when using directly on browser with
<script src="vue-google-charts.browser.js"></script>The text was updated successfully, but these errors were encountered: