{path: '/foo', component: HelloWorld},
                  
                  
                      {path: '', component: HelloWorld},
                  
                  
                      {path: '/', component: HelloWorld}
                  
                  
                  ];
                  
                  
                  export default routers
                  
                  
                  template App
                  
                  
                  <template>
                  
                  
                      <router-view></router-view>
                  
                  
                  </template>
                  
                  
                  Вот так роуты подгружаю:
                  
                  
                  import routers from './router';
                  
                  
                  Vue.use(VueRouter);
                  
                  
                  const router = new VueRouter({routers});
                  
                  
                  
                  
                  
                  new Vue({
                  
                  
                      router,
                  
                  
                      render: h => h(App),
                  
                  
                  }).$mount('#app');
                  
                  
                  HelloWorld не отрисовывается, что я делаю не так?
                  
                  
                
 Dmitriy
                          Firsov
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Dmitriy
                          Firsov
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  в консоли ошибок нет
убери как вариант render: h => h(App),
 Dmitriy
                          Firsov
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                      
                      
                        
                          Dmitriy
                          Firsov
                        
                      
                    
                    
                    
                    
                      Автор вопроса
                    
                    
                  сделал так: new Vue({ router, }).$mount('#app'); Только ошибка вывалилась [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build. Я так понял базовый компанент не находит - что логично
Там ключ routes должен называться
Обсуждают сегодня