Answer the question
In order to leave comments, you need to log in
vue router not working, why?
I don’t understand why the components are not substituted in place of the router-view.
Here is the code in router.js :
import Vue from 'vue';
import VueRouter from 'vue-router';
import StepOneMain from "@/components/Main/Step-1-Main.vue";
import MapSearch from '@/components/mapSearch/index.vue'
import ipotekaApp from '@/components/ipotekaApp.vue';
Vue.use(VueRouter)
export default new VueRouter({
mode: 'history',
routes: [
{
path: '/ipoteka',
name: 'ipotekaSteps',
component: ipotekaApp,
children: [
{ path: 'main', name: "main", component: StepOneMain }
]
},
{
path: '/search', name: 'mapSearch', component: MapSearch
}
]
})
import Vue from 'vue';
import App from './components/App';
require('./bootstrap');
import Header from './components/Header_Footer/Head.vue';
Vue.component('compHeader', Header);
import router from './routers/routers.js';
import { store } from './store/store.js';
const app = new Vue({
el: '#app',
render: h => h(App),
store,
router
});
<template>
<div id="app" class="app">
<compHeader :options="options"></compHeader>
<router-view></router-view>
<Footer></Footer>
</div>
</template>
<script>
import Footer from "./Header_Footer/Footer.vue";
export default {
components: {
Footer
}
};
</script>
<template>
<div class="app-overlay" id="app">
<div class="app-wrapper">
<div class="main-wrapper">
<div class="main-block">
</div>
</div>
</div>
</div>
</template>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question