euvl / vue-js-toggle-button

:fish_cake: Vue.js 2 toggle / switch button - simple, pretty, customizable
http://vue-js-toggle-button.yev.io/
MIT License
934 stars 133 forks source link

How can i use this with the cdn inside the simple Html website? #136

Open usamamashkoor opened 4 years ago

usamamashkoor commented 4 years ago

Hi, I want to add this inside my simple HTML website using CDN, how can I do that I can not seem to find any CDN URL.

Kindly let me know.

Thanks

abulka commented 4 years ago

This is page with a cdn url https://www.jsdelivr.com/package/npm/vue-js-toggle-button?tab=collection but not sure how to import and Vue.use(ToggleButton) it?

trush44 commented 4 years ago

Also wondering how to use the Component in a simple HTML page. I don't have the ability 'import' due to the software I'm integrating with. With the BootstrapVue components they "just work" as long as I reference the js/css URLs, but this one I can't figure out how to render the components.

joelnordell commented 4 years ago

@usamamashkoor you can do it like this:

<head>
   ... your other scripts here ...
   <script src="//cdn.jsdelivr.net/npm/vue-js-toggle-button@1.3.3"></script>
</head>

And then before you construct your Vue application, add this:

window['vue-js-toggle-button'].default.install(Vue);
djdance commented 2 years ago

... or you can use this call

Vue.use(window['vue-js-toggle-button'].default)