Using Vue.js for non SPA’s
Tuesday, December 08, 2015
Ok so for me right now I’m digging into the excellent Vue.js and looking to use it in a number of projects. But one thing got me out of the box was how can I use Vue globally with creating multiple instances for the different pages of the site. Ok so you might be thinking WTF is he on about. So let me explain a little more.
I am using Browserify and gulp to combine my scripts so I end up with one single file to load reducing the number of requests for the client and thus lies the problem. If I have multiple instances of Vue within the single file Vue would complain not finding the binding element on a page. Also if for example I had a subscription component I would have to require that in the separate instances.
0 comments