Skip to content

Commit

Permalink
fix(taro-runtime): fix (#7296) problem that router path field is empt…
Browse files Browse the repository at this point in the history
…y in h5 environment
  • Loading branch information
ZeroTo0ne authored and Chen-jj committed Jan 27, 2021
1 parent 210d897 commit 2b05425
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 @@ -106,10 +106,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 @@ -161,10 +161,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 2b05425

Please sign in to comment.