Please support bower
For what?
Hey @BruinY, package should be available using bower. Let me know if it works for you 馃槃
@euvl , @BruinY , how exactly connect it with Bower? I have installed the package and included index.js from dist/ after vue.js
<script type="text/javascript"
src="{{ asset('bower_components/vue-js-modal/dist/index.js') }}"></script>
But after Vue.use(VModal);
I have an error
VModal is not defined
I can't do import vmodal from 'vue-js-modal'
because I don't use ES6 or any build tool.
UPD
Solved with Vue.use('vue-js-modal');
UPD
Now I have the error
Unknown custom element: <modal> - did you register the component correctly?
Have tried Vue.component('modal', 'vue-js-modal');, another error
Invalid Component definition: vue-js-modal
How to use it in ES5?
Just follow the docs pls.
@euvl, docs are for ES6.
import VModal from 'vue-js-modal'
Vue.use(VModal)
I can't do this because there is no import and export in ES5. There is no docs about how to use lib when I just include js via
<script type="text/javascript"
src="{{ asset('bower_components/vue-js-modal/dist/index.js') }}"></script>
@seyfer
Vue.use(window["vue-js-modal"].default); will load it correctly if you just load the file in browser.
Beware, though, I've only done this in Chrome and (so far) so good. Your mileage may vary.
PS. For those wondering 'why not NPM it?' i'm working in a legacy system and using Vue as a drop-in way to add some functionality until a full re-write/migration can be performed. NPM pipelines are just not always an option in your tech stack.
@Vassi thank you!
+1 to the PS about why not NPM.
If library authors do not support using it without NPM and Webpack - they actually loose users and make them stay with jQuery. It's not good at all. For example, I'm switching to Vue and in the end, have implemented my own modal component.
Well thats a shame @seyfer.
Good point @Vassi, I will get it to docs 馃憤
@seyfer
Your opinion on authors "they actually loose users and make them stay with jQuery" made me think that you are misunderstanding how the open source works.
Authors do not have to attract users, because they are not businesses.
I, personally, do not get any profit from this project, I just do it because I dont mind other people using my code.
So when you say that i must do something for you, because you switched to Vue and " have implemented my own modal component." - well, it's your job, so just do it. I owe you nothing.
P.S. jquery is not an option for 2017, some real-life experience will show it.
@euvl, you got me wrong.
I mean that such position does not help and not encourage users to switch from jQuery to Vue.
It does not help the community to move forward. The more developers will abandon jQuery and pick Vue - the better. But if library authors not give a support and not help - it's less likely that devs would choose something new. Because job needs to be done and there is no time.
So, because I clearly understand open source community, I think, such position harms the community.
You do not must and you owe nothing to anybody, that's right. Just think about the contribution, if you would make it easier to use your library with ES5 in an "old way" - the more developers would switch to Vue.
And adding documentation for such users is a good idea. This is what I meant to say.
So, you have added it. Now it's ok.
Most helpful comment
@seyfer
Vue.use(window["vue-js-modal"].default); will load it correctly if you just load the file in browser.
Beware, though, I've only done this in Chrome and (so far) so good. Your mileage may vary.
PS. For those wondering 'why not NPM it?' i'm working in a legacy system and using Vue as a drop-in way to add some functionality until a full re-write/migration can be performed. NPM pipelines are just not always an option in your tech stack.