Answer the question
In order to leave comments, you need to log in
Why doesn't vue see routes?
src/router/router.js
import Vue from "vue";
import Router from "vue-router";
import index from '../page/index.vue'
import cart from '../page/cart.vue'
Vue.use(Router)
const router = new Router({
routers: [
{
path: '/',
name: 'index',
component: index
},
{
path: '/cart',
name: 'cart',
component: cart
},
]
})
export default router;
import Vue from 'vue'
import App from './App.vue'
import router from "./router/router";
import 'materialize-css/dist/css/materialize.min.css'
import 'material-design-icons/iconfont/material-icons.css'
Vue.config.productionTip = false
new Vue({
router,
render: h => h(App),
}).$mount('#app')
[vue-router] Route with name 'index' does not exist
[vue-router] Route with name 'cart' does not exist
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