Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liuhong1happy/similar-react-native-router
similar react-native-router
https://github.com/liuhong1happy/similar-react-native-router
react react-native react-native-router react-router similar-react-native-router
Last synced: 12 days ago
JSON representation
similar react-native-router
- Host: GitHub
- URL: https://github.com/liuhong1happy/similar-react-native-router
- Owner: liuhong1happy
- License: mit
- Created: 2016-10-30T10:37:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-12T12:37:13.000Z (almost 8 years ago)
- Last Synced: 2024-04-26T08:20:56.484Z (8 months ago)
- Topics: react, react-native, react-native-router, react-router, similar-react-native-router
- Size: 179 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# similar-react-native-router
similar react-native-router
## 安装
npm install --save similar-react-native-router
## 用法```js
import {Router,Route,Link,RouteHistory} from 'similar-react-native-router';
var RouterApp = ()=>{
return (
)
}
```## API
- Router 定义根路由,指定defaultRoute(默认路由)
- path 路由名称,这里指定为"/" `String`
- component 路由对应的组件 `React.Component`
- defaultRoute 默认路由 `String`
- Route 定义路由,可包含子路由,允许定义[:id]格式路由,默认允许传递[?id=xxx]方式
- path 路由名称,这里指定为"/" `String`
- component 路由对应的组件 `React.Component`
- children 子路由 `Array or `
- Link 简单路由链接
- name 跳转到的路由名称 `String`
- onPress 路由点击回调函数,内部已经实现路由跳转 `Function`
- config 跳转动画方式 `Navigator.SceneConfigs`
- RouteHistory 路由操纵,注意以下是属性或者方法,非props。
- pushRoute 修改当前路由,不适合后退页面,适合平行页面之间跳跃 `Function(name,index,config)`
- resetToRoute 重置route,适合首次初始化的时候,例如登录应用过后 `Function(name,index,config)`
- popRoute 后退到上一级 `Function`
- popToRoute 后退多级 `Function(name)`
- curHash 当前路由 `String`
## 特点
1. similar-react-native-router采用ES6写法。
2. 高度模仿react-router组件,采用Navigator实现,使用便捷。
## 联系方式
Email: [liuhong1happy]([email protected])