react-router的 <Link/>中的属性
来源:互联网 发布:ubuntu无法显示中文 编辑:程序博客网 时间:2024/06/03 17:46
使用Link标签
// 字符串定位描述符 String location descriptor.<Link to="/hello"> Hello</Link>// 对象定位描述符 Object location descriptor.<Link to={{ pathname: '/hello', query: { name: 'ryan' } }}> Hello</Link>// 函数返回定位描述符Function returning location descriptor.<Link to={location => ({ ...location, query: { name: 'ryan' } })}> Hello</Link>
属性描述
activeClassName
当被点击时,的className接受一个它的值(activeClassName),默认情况下它是不激活;
activeStyle
当被点击时,activeStyle中的值会添加到转换后的<a/>
中,样式是style="color:red;"
onClick(e)
自定义单击事件处理程序。
- e.preventDefault():阻止默认事件
- e.stopPropagation():阻止事件冒泡
onlyActiveOnIndex
如果onlyActiveOnIndex的值是true,中的路径完全匹配时才会连接指定路由
其它
也可以在上定义 title、id、className属性;
1 0
- react-router的 <Link/>中的属性
- 关于react-router中<Link>的调试: You should not use <Link> outside a <Router>
- react-router-dom 通过Link传值的坑人表现!
- React中的Router
- react-router 中的history
- 关于React中的路由的react-router的案例
- react-router的改变
- 使用vue的router-link
- router-link的学习使用
- react路由基础(Router、Link和Route)
- react-router 学习笔记之Link带参数传值
- react-router带参数使用Link跳转并取出参数
- react-router 4.2.0<link>页面跳转-传参与不传参
- react-router 学习笔记之Link带参数传值
- vue-router 的属性
- react router去除url中的k参数
- ReactNative React-native-router-flux框架---刷新当前页面的属性
- vue中 router-link的简单使用
- 使用nginx与nginx-rtmp-module搭建流媒体服务器
- Myeclipse错误:Errors occurred during the build. Errors running builder 'DeploymentBuilder' on project
- Ubuntu14.04 MySQL安装及权限配置
- tensorflow tutorials(十):用tensorflow实现降噪自编码器(Denoising Auto-Encoder)
- 微信扫码支付
- react-router的 <Link/>中的属性
- eclipse项目缺少maven本地仓库jar包
- scala 学习(十六)——闭包和柯里化
- chap2 kNN算法 2.2.2 分析数据:使用Matplotlib创建散点图
- jquery动画
- FFMPEG-3.2.2 SDL-2.0.5(2)
- 驼峰命名法转下划线风格
- 二分法求方程2x³-4x²+3x-6=0的近似解
- HTML——定义字符格式