How to use on browser without npm
fandisus opened this issue · 2 comments
Hi i tried using unpkg to include the script at the bottom of my html.
<script src="https://unpkg.com/vue-simple-context-menu/dist/vue-simple-context-menu.min.js" ></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/vue-simple-context-menu/dist/vue-simple-context-menu.css" />
In web console, I got:
Uncaught TypeError: c.use is not a function
at vue-simple-context-menu.min.js?=1660744890769:1:4474
at vue-simple-context-menu.min.js?=1660744890769:1:4507
Could somebody please put some example.html which demonstrate the usage of unpkg version?
I just tried the browser-install version for a bit and I ran into a similar issue. I also had trouble accessing the showMenu
ref function.
When I upgraded this package to v4.0.0, I am almost positive I ran all this and confirmed it worked at that point. But I may be mistaken.
Nowadays it is common to not support a browser version as it complicates the library creation process. I'd rather drop support for it than continue to debug the issue. I never have used the browser version myself, and from what I'm seeing it's not a popular option. The time spent is not worth it there.
So I've removed the instructions from the README.
As far as what the issue is - it probably has something to to do with the way Vue 3 deals with refs. If you use the new Vue 3 composition API - you may be able to get around this. I personally don't use the new composition myself.
Sorry for the trouble. Thanks for raising.
Okay. Thanks for the quick response :)