Skip to content

Commit

Permalink
fix(router): 修复navigateBack不带参数时报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Littly committed Jul 23, 2018
1 parent 797511d commit 9d8078c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/taro-router/src/lib/apis.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import h from './history'
import resolvePathname from './resolvePathname'

const navigateTo = function (opts) {
const navigateTo = function (opts = {}) {
const current = h.now()
const currentUrl = current.url
opts.url = resolvePathname(opts.url, currentUrl)
h.push(opts)
}

const navigateBack = ({delta}) => {
const navigateBack = ({delta = 1}) => {
window.history.go(-1 * delta)
}

const redirectTo = function (opts) {
const redirectTo = function (opts = {}) {
const success = opts.success
const fail = opts.fail
const complete = opts.complete
Expand Down

0 comments on commit 9d8078c

Please sign in to comment.