<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的更多相关文章

  1. [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 ...

  2. Vue router link

    html: <router-link to="test">Go to Foo</router-link> <router-link to=" ...

  3. [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 ...

  4. angular2 学习笔记 ( Router 路由 )

    参考 : https://angular.cn/docs/ts/latest/guide/router.html#!#can-activate-guard https://angular.cn/doc ...

  5. [React] React Router: Redirect

    The Redirect component in react-router does exactly what it sounds like. It allows us to redirect fr ...

  6. [React] React Router: Querystring Parameters

    Define query param in Link, accept path and query : const Links = () => <nav > <Link to= ...

  7. [React] React Router: Named Components

    In this lesson we'll learn how to render multiple component children from a single route. Define a n ...

  8. [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 ...

  9. [React] React Router: IndexRoute

    IndexRoute allows us to define a default child component to be rendered at a specific route when no ...

  10. [React] React Router: Nested Routes

    Since react-router routes are components, creating nested routes is as simple as making one route a ...

随机推荐

  1. git 命令 查看历史提交 git log

    怎么理解git commit 命令 git commit 相当于 我们虚拟机快照操作,每次执行commit命令 相当于对本地仓库做一次快照,保存了当时仓库的状态, git commit -m 加上的& ...

  2. Linux文件权限实践

    用户测试准备: groupadd incahome ##一个家庭(dongdaxia的家) useradd dongdaxia -g incahome ##让家庭主人dongdaxia属于incaho ...

  3. JavaSE基础(三)--Java基础语法

    Java 基础语法 一个 Java 程序可以认为是一系列对象的集合,而这些对象通过调用彼此的方法来协同工作.下面简要介绍下类.对象.方法和实例变量的概念. 对象:对象是类的一个实例,有状态和行为.例如 ...

  4. mysql innodb索引原理

    聚集索引(clustered index) innodb存储引擎表是索引组织表,表中数据按照主键顺序存放.其聚集索引就是按照每张表的主键顺序构造一颗B+树,其叶子结点中存放的就是整张表的行记录数据,这 ...

  5. Prefix and Suffix Search

    Given many words, words[i] has weight i. Design a class WordFilter that supports one function, WordF ...

  6. *** 没有规则可以创建目标“test”。 停止。

    在编译Linux模块时出现这个问题,在仔细检查了Makefile没有错误后,重名了了该源程序和Makefile所在文件夹的名字,与源程序名字一致,然后问题就消失了!它们的关联体现在哪啊!?

  7. php exec执行不等待返回结果

    windows中:pclose(popen("start php.exe test.php","r"));lnuix中: pclose(popen(" ...

  8. 安装laravel框架

    方式一:Windows版本通过composer来下载安装laravel框架 一:laravel是php的一个web框架.laravel框架安装主要依赖composer工具,本经验就介绍一下怎么在win ...

  9. linux下selenium+phantomjs环境

    # 安装依赖软件yum -y install wget fontconfig # 下载PhantomJSwget -P /tmp/ https://bitbucket.org/ariya/phanto ...

  10. 父窗体的委托,子窗体注册,this.Owner是关键

    //声明委托 public delegate void RefreshParentHandler<T>(T obj); //父窗体的委托 public RefreshParentHandl ...