1.输入代码安装: npm i -vue-router 如图所示: 下载安装完毕: 2.在main.js中引入vue-router import VueRouter from 'vue-router' 如图所示: