vue 实战初遇的问题

控制台提醒内容如下:

[vue-router] Duplicate named routes definition: { name: "[object Object]", path: "/search" }---vue-router.esm.js?fe87:16

那么就表明你在给组件路由的name属性,忘记加上引号,即name: search,

正确的书写方式是:name: 'search'

控制台报错,并且不能显示组件内容,报错内容如下:

TypeError: Cannot read property '$createElement' of undefined

    at render (eval at ./node_modules/vue-loader/lib/template-compiler/index.js?{"id":"data-v-16a63e9c","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/search/search.vue

极可能表明你在给组件编写路由的时候,component属性错写成components

正确的书写方式是:component: search


你可能感兴趣的:(Cannot,read,property,'$createE)