after I created the template through the vuecli scaffolding, I deleted the original code in the entry function main.js and wrote a routing DEMO, myself, but consloe did not report an error, and there was no target component. I couldn"t find it for a few days. I asked for help from the prawns
.import Vue from "vue"
import VueRouter from "vue-router"
Vue.config.productionTip = false
Vue.use(VueRouter)
var homePage={template:"<div></div>"}
var fristPage={template:"<div>11111</div>"}
var secPage={template:"<div>22222</div>"}
var router=new VueRouter({
mode:"history",
base:__dirname,
routes:[
{path:"/",component:homePage},
{path:"/fri",component:fristPage},
{path:"/sec",component:secPage}
]
})
/* eslint-disable no-new */
new Vue({
router,
teamlate:`<div id="headnav">
<h1></h1>
<ul>
<li><router-link to="/"></router-link></li>
<li><router-link to="/fri">FRI</router-link></li>
<li><router-link to="/sec">SEC</router-link></li>
</ul>
<router-view/>
</div>`
}).$mount("-sharpapp")