Skip to content

Commit

Permalink
fix(taro-runtime): fix (NervJS#7296) problem that router path field i…
Browse files Browse the repository at this point in the history
…s empty in h5 environment
  • Loading branch information
ZeroTo0ne committed Nov 24, 2020
1 parent 7230417 commit 293af46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/taro-runtime/src/dsl/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ export function createPageConfig (component: any, pageName?: string, data?: Reco
}

const path = getPath(id, options)

const router = isBrowser ? path : this.route || this.__route__
Current.router = {
params: options,
path: addLeadingSlash(this.route || this.__route__),
path: addLeadingSlash(router),
onReady: getOnReadyEventKey(id),
onShow: getOnShowEventKey(id),
onHide: getOnHideEventKey(id)
Expand Down Expand Up @@ -145,10 +145,10 @@ export function createPageConfig (component: any, pageName?: string, data?: Reco
Current.page = this as any
this.config = pageConfig || {}
const path = getPath(id, this.options)

const router = isBrowser ? path : this.route || this.__route__
Current.router = {
params: this.options,
path: addLeadingSlash(this.route || this.__route__),
path: addLeadingSlash(router),
onReady: getOnReadyEventKey(id),
onShow: getOnShowEventKey(id),
onHide: getOnHideEventKey(id)
Expand Down

0 comments on commit 293af46

Please sign in to comment.