1.0.5 • Published 7 years ago

aotoo-rn-router v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

aotoo-rn-router 端内置插件库

USAGE

/*
 * config: 路由配置文件, 
 * config.props: 路由react class的props
 * styles: 路由样式表
*/
router(config, styles)

CODE

import aotoo from 'aotoo'
require('aotoo-rn-widgets')
const router = require('aotoo-rn-router')

const contents = {
  first: require('./some/first'),
  page2: require('./some/page2'),
  page3: require('./some/page3'),
  detail: require('./some/detail')
}

const routerData = [
  {title: 'first', path: 'first', content: contents.first},
  {title: 'page2', path: 'page2', content: contents.page2},
  {title: 'page3', path: 'page3', content: contents.page3},
  {title: 'detail', path: 'detail', content: contents.detail},
]

const routerIns = router({ 
  props: { 
    data: routerData, 
    start: 0 
  }
})

routerIns.rendered = function(){
  setTimeout(function(){
    routerIns.goto('/path', {param})
  }, 3000)
}

return routerIns.render()
1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago