Skip to content

Commit

Permalink
feat(h5): h5支持中文页面路径名称 (#11604)
Browse files Browse the repository at this point in the history
  • Loading branch information
dengxiang authored Apr 15, 2022
1 parent a727626 commit cc38c77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/taro-components/src/components/tabbar/tabbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class Tabbar implements ComponentInterface {
url = location.pathname
}
const processedUrl = addLeadingSlash(stripBasename(url, routerBasename))
return processedUrl === '/' ? this.homePage : processedUrl
return decodeURI(processedUrl === '/' ? this.homePage : processedUrl)
}

getOriginUrl = (url: string) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-router/src/router/spa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function createRouter (
app.onLaunch?.(launchParam)

const render: LocationListener = async ({ location, action }) => {
handler.pathname = location.pathname
handler.pathname = decodeURI(location.pathname)
let element
try {
element = await router.resolve(handler.router.forcePath || handler.pathname)
Expand Down

0 comments on commit cc38c77

Please sign in to comment.