pomace-router

pomace router module

Usage no npm install needed!

<script type="module">
  import pomaceRouter from 'https://cdn.skypack.dev/pomace-router';
</script>

README

pomace-router

动态属性

router.times

当前历史进入次数。

router.current

当前路由路径。

router.currentParams

当前路由路径的参数。

router.currentRouteParams

当前路径参数。

router.recordRoutes

历史路径及参数。

方法

router.init( callback )

参数说明

callback       回调定义,实参use
use.indexPath  定义根路径
use.path       定义其他路径
use.entry      定义进入事件
use.leave      定义离开事件

router.go( routeName, params )

参数说明

routeName 路由名称
params 路由参数

router.out( routeName, params )

参数说明

routeName 路由名称
params 路由参数

router.back( times )

参数说明

times 历史次数