LoginSignup
3
0

More than 3 years have passed since last update.

Vue Router で TypeError: Cannot read property '_c' of undefined

Posted at

症状

ページが遷移しない。
以下のようなログが出力される。

vue-router.esm.js?880d:1921 TypeError: Cannot read property '_c' of undefined

原因

単純にタイプミス

誤: components
正: component
import Vue from 'vue';
import VueRouter from 'vue-router';
import Top from './views/Top.vue';
import Portfolio from './views/Portfolio.vue';
import Stocks from './views/Stocks.vue';

Vue.use(VueRouter);
const routes = [
  {
    path: '/',
    name: 'top',
    components: Top,  // <- s 要らない
  },
  {
    path: '/portfolio',
    name: 'portfolio',
    components: Portfolio,  // <- s 要らない
  },
  {
    path: '/stocks',
    name: 'stocks',
    components: Stocks,  // <- s 要らない
  },
];

export default new VueRouter({
  routes,
});

きっかけ

これで気づけた

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0