我是 laravel 和 Vue 的新手。我正在尝试使用 vue-router 重定向到特定链接。我<router-view></router-view>在主要内容中插入了,id=app也用作<router-link>下面的代码,但是当我点击链接时没有任何反应。
require('./bootstrap');
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
let routes = [
{path:'/dashboard', component:require('./components/Dashboard.vue')},
{path:'/profile', component:require('./components/Profile.vue')}
];
const router = new VueRouter({
mode:'history',
routes
});
import Profile from './components/Profile.vue'
import Dashboard from './components/Dashboard.vue'
const app = new Vue({
el: '#my-app',
components:{
Profile,
Dashboard
},
router,
});
富国沪深
相关分类