VUE从A页面路由跳转到B页面后页面空白,路由配置如下:
import Vue from 'vue' import Router from 'vue-router' import HomeView from '@/views/HomeView' import PlayView from '@/views/PlayView' Vue.use(Router) export default new Router({ // mode: 'history', routes: [ { path: '/', name: 'HomeView', component: HomeView }, { path: '/play', name: 'PlayView', Component: PlayView }, { path: '*', redirect: '/' } ] })
试过多种跳转方式都不行,控制台也没有任何报错!
<router-link to="/play">Go to Play</router-link> this.$router.push({path: '/play', query: {testid: 111}}) // this.$router.push({path: 'play'}) // this.$router.push('/play')
最后发现困扰我很久的问题竟出现在大小写上面
应该是 component 而不是 Component
转载请注明本文标题和链接:《 记一次VUE路由跳转后页面空白 》
网友评论 0