第一种是使用vue-cli搭建出来的,可以简单概括为几个步骤,安装vue-router(cnpm install vue-router --save)>在main.js(入口文件)引入>在入口文件注册并且实例化>在入口文件定义路由>创建和挂载根组件

咋一看像个tab页的切换,tab页只能处理页面内的tab页的切换。使用路由来切换的话,就是SPA



第二种方法比较简单,就是传统引入vue.js和vue-router.js
第一种是使用vue-cli搭建出来的,可以简单概括为几个步骤,安装vue-router(cnpm install vue-router --save)>在main.js(入口文件)引入>在入口文件注册并且实例化>在入口文件定义路由>创建和挂载根组件
咋一看像个tab页的切换,tab页只能处理页面内的tab页的切换。使用路由来切换的话,就是SPA
第二种方法比较简单,就是传统引入vue.js和vue-router.js
本文标题:vue-router跳转两种不同的方式
本文链接:https://www.haomeiwen.com/subject/hambpxtx.html
网友评论