[Vuejs]-Separating var app = new Vue({}); to another app.js

0👍

May be you need to define different id for each app.

// frist page

// html
<div id="blog-app">
  {{ message }}
</div

// js
var blogApp = new Vue({
  el: '#blog-app', // <-this id
  data: {
    message: 'Hello Blog!'
  }
})



// second page

// html
<div id="gallery-app">
  {{ message }}
</div

// js
var galleryApp = new Vue({
  el: '#gallery-app', // <-this id
  data: {
    message: 'Hello Gallery!'
  }
})

// .. and so on

may be this can help to separate these apps.

if any doubt please comment.

Leave a comment