Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(taro-runtime): fix (#7296) problem that the path is empty through the useRouter method in the h5 environment #8122

Merged
merged 2 commits into from
Jan 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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