problem description
vue-router.js?dfba:1800 Uncaught TypeError: Cannot read property "component" of undefined
the environmental background of the problems and what methods you have tried
everything is loaded in that browser! I have tried that the previous version of npm install vue-router@nex, is not compatible, and I have tried to make him work on the command line! That"s what happened!
Picture description
related codes
/ / Please paste the code text below (do not replace the code with pictures)
main.js!
/ / The Vue build version to load with the import
command
/ / (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import App from". / App";
/ / import router from". / router";
import VueRouter from "vue-router";
import goods from. / components/goods/goods";
Vue.config.productionTip = false;
Vue.use (VueRouter);
let app = Vue.extend (App);
let router = new VueRouter ();
router.map ({
"/ goods": {
component: goods
}
});
router.start (app,"- sharpapp");
App.vue
< template >
< div id= "app" >
<v-header></v-header>
<div class="tab">
<div class="tab-item">
<!--v-link-->
<!--path: "" -->
<a v-link to="/goods"></a>
</div>
<div class="tab-item">
<a v-link to="/ratings"></a>
</div>
<div class="tab-item">
<a v-link to="/seller"></a>
</div>
</div>
<router-view></router-view>
< / div >
< / template >