In advance, I know that this is not a question that you ask, but I do not know why you need two instances of Vue. Why not just associate Vue with the body and treat Vue instances as components. It may be difficult for you to do what you are trying to do, because it was not intended. Perhaps it was, I do not know. I put Vue on the body and I did not see a performance hit. Here is the JSBin .
HTML
<div class="container"> <div id="app1"> <h1>{{ msg }}</h1> <input type="text" v-model="msg" class="form-control"/> </div> <div id="app2"> <h1>{{ msg }}</h1> <input type="text" v-model="msg" class="form-control"/> </div> </div>
Javascript
var VueComponent1 = Vue.extend({ template: '#app1', data: function(){ return { msg: "" } } }); var VueComponent2 = Vue.extend({ template: '#app2', data: function(){ return { msg: "" } } }); var app1 = Vue.component('app1', VueComponent1); var app2 = Vue.component('app2', VueComponent2); var app = new Vue({ el: 'body', data: { msg: 'Everybody loves Vue.' } });
If you're looking for a better way to split your code, you can check out this Vue with the Browserify example .
Laracasts has a free series on Vue, which was also pretty informative.
source share