• 通过路由实例进行调用push或replace
    • push和replace使用方式都一样,只不过replace不会改变history对象
  • child::

    跳转history

    This method takes a single integer as parameter that indicates by how many steps to go forward or go backward in the history stack, similar to window.history.go(n). Examples

    // go forward by one record, the same as router.forward()
    router.go(1)
    // go back by one record, the same as router.back()
    router.go(-1)
    // go forward by 3 records
    router.go(3)
    // fails silently if there aren't that many records
    router.go(-100)
    router.go(100)
    指向原始笔记的链接

实例

基础

路由实例.push("/home")

进阶

// literal string path
router.push('/users/eduardo')
// object with path
router.push({ path: '/users/eduardo' })
// named route with params to let the router build the url
router.push({ name: 'user', params: { username: 'eduardo' } })
// with query, resulting in /register?plan=private
router.push({ path: '/register', query: { plan: 'private' } })
// with hash, resulting in /about#team
router.push({ path: '/about', hash: '#team' })