router-link
<router-link> 组件支持用户在具有路由功能的应用中 (点击) 导航。 通过 to 属性指定目标地址,默认渲染成带有正确链接的 <a> 标签,可以通过配置 tag 属性生成别的标签.。另外,当目标路由成功激活时,链接元素自动设置一个表示激活的 CSS 类名router-link-active。
编程式导航:
path
name+params
path+query
如果用path+params,后面的params不会生效
命名多个视图:
router.beforeEach全局前置守卫
router.beforeResolve全局解析守卫
router.afterEach全局后置钩子
beforeEnter路由独享守卫
组件内的守卫:beforeRouterEnter(不能访问this,守卫在导航确认前被调用,因此即将登场的新组件还没被创建。不过,你可以通过传一个回调给 next来访问组件实例。在导航被确认的时候执行回调,并且把组件实例作为回调方法的参数。)、beforeRouterUpdate、beforeRouterLeave(这个离开守卫通常用来禁止用户在还未保存修改前突然离开。该导航可以通过 next(false) 来取消。)
router-link的更多相关文章
- [Redux] Navigating with React Router <Link>
We will learn how to change the address bar using a component from React Router. In Root.js: We need ...
- Vue router link
html: <router-link to="test">Go to Foo</router-link> <router-link to=" ...
- [React] React Router: Router, Route, and Link
In this lesson we'll take our first look at the most common components available to us in react-rout ...
- angular2 学习笔记 ( Router 路由 )
参考 : https://angular.cn/docs/ts/latest/guide/router.html#!#can-activate-guard https://angular.cn/doc ...
- [React] React Router: Redirect
The Redirect component in react-router does exactly what it sounds like. It allows us to redirect fr ...
- [React] React Router: Querystring Parameters
Define query param in Link, accept path and query : const Links = () => <nav > <Link to= ...
- [React] React Router: Named Components
In this lesson we'll learn how to render multiple component children from a single route. Define a n ...
- [React] React Router: Route Parameters
A router library is no good if we have to hardcode every single route in our application. In this le ...
- [React] React Router: IndexRoute
IndexRoute allows us to define a default child component to be rendered at a specific route when no ...
- [React] React Router: Nested Routes
Since react-router routes are components, creating nested routes is as simple as making one route a ...
随机推荐
- Recordset对象的Open方法
Recordset对象的Open方法原型: Open([Source],[ActiveConnection],[CursorType],[LockType],[Options]) CursorType ...
- 【LOJ】#3042. 「ZJOI2019」麻将
LOJ#3042. 「ZJOI2019」麻将 如何判定一个集合牌有没有胡的子集是不是胡的 就用一个\(dp[j][k][0/1]\)表示有j个连续两个的串,有k个连续1个串,有没有对子,再记一下这个集 ...
- _variant_t 与其他数据类型的转换
在COM中使用的标准类Class如下所示: _bstr_t:对BSTR类型进行打包,并提供有用的操作方法: _com_error:定义抛出的error对象; _com_ptr_t:封装COM接口指针 ...
- 在Windows平台上运行Tomcat
从之前的学习中知道,可以调用Bootstrap类将Toomcat作为一个独立的应用程序来运行,在Windows平台上,可以调用startup.bat批处理文件来启动Tomcat,或运行shutdown ...
- C#面向对象9 字符串
1.字符串的不可变性 当你给一个字符串重新赋值之后,老的值并没有销毁,而是重新开辟了一块空间(堆)存储新的值. **当程序结束后,GC扫描整个内存,如果发现有的空间没有被指向,则立即把它销毁. 示意图 ...
- 搭建自己的框架WedeNet(四)
WedeNet2018.Web-UI层:结构如下: 首先,在Controller中定义BaseController,以便加入统一处理逻辑,如下: using log4net; using System ...
- CSS3溢出文字省略
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- HTML的学习(注释)
<!--charset 编码字符集--> <!--UTF-8 万国码 gb2312 中国标准第2312条 中文,韩文....大部分的亚裔语言(繁体字不支持) GBK 在上面的基础之上 ...
- app欢迎页问题
今天替换app中的图片,打包成apk后,欢迎页的图片怎么替换都还是旧的,尝试多次以后,确定以及肯定是替换成功了的,而且替换的也都对,只好清理了一下项目,重新build,最后再打包,结果成功了!真是坑! ...
- vbox的四种网络模式
一.NAT模式 特点: 1.如果主机可以上网,虚拟机可以上网 2.虚拟机之间不能ping通 3.虚拟机可以ping通主机(此时ping虚拟机的网关,即是ping主机) 4.主机不能ping通虚拟机 ...