使用Vue路由的一些疑惑总结。

当index.html或,index.ejs作为第一个页面被加载时,会加载我们的主main.js(不管你这的名字取的是什么,总会有一个主js文件),一般会有如下代码:

new Vue({
  components: { App },
  router,
  store,
  template: ''
}).$mount('#app')

而index.html一般如下:



  
    
    APP
    <% if (htmlWebpackPlugin.options.nodeModules) { %>
      
      
    <% } %>
  
  
    

那么Vue的实例在

这个标签的范围内有效。router将会匹配第一个出现的 并替换它。

你可能感兴趣的:(使用Vue路由的一些疑惑总结。)