2017-06-13 4 views
0

vue-routerに問題があり、$ router.pushとpropsで別のものにリダイレクトしようとしています。 ここでは、コードです:ルート定義で

this.$router.push({path: '/badges/search', query: {filter: item.tag_id}}) 

{ path: '/badges', 
    name: 'Badges', 
    component: require('./components/pages/Badges.vue'), 
    beforeEnter: requireAuth, 
    children: [{ 
     path: 'search', 
     name: 'Badge-id', 
     components: require('./components/pages/Badges.vue'), 
     props: (route) => ({filter: route.query.filter}) 
    }] 
} 

そして最後に、ここで私が手にエラーがあります:私はこのエラーを取得する理由

vue-router.esm.js:1697 TypeError: Cannot read property '_c' of undefined 
at render (http://localhost:8080/app.js:27823:91) 
at http://localhost:8080/app.js:30450:17 
at http://localhost:8080/app.js:30477:66 
at Array.map (native) 
at http://localhost:8080/app.js:30477:38 
at Array.map (native) 
at flatMapComponents (http://localhost:8080/app.js:30476:26) 
at http://localhost:8080/app.js:30415:5 
at iterator (http://localhost:8080/app.js:30220:7) 
at step (http://localhost:8080/app.js:30103:9) 

誰かがアイデアを持っていますが、 ?また、作成したメソッドの新しいコンポーネント(バッジ)に "this"オブジェクトを記録しようとすると、whileループでも "未定義"と異なることはありません(無限になりました)

ありがとう助けて !送信用

答えて

-1

使用paramsは小道具:

この$のrouter.push({パス: '/バッジ/検索'、paramsは:{フィルタ:item.tag_id}})

関連する問題