Skip to content

Commit

Permalink
fix: loadParams
Browse files Browse the repository at this point in the history
  • Loading branch information
human committed Jan 16, 2025
1 parent b6e512d commit 213c000
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/core/src/platform/patch/getDefaultOptions.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,14 @@ export function getDefaultOptions ({ type, rawOptions = {}, currentInject }) {
if (!global.__mpxAppHotLaunched && global.__mpxAppOnLaunch) {
global.__mpxAppOnLaunch(props.navigation)
}
const loadParams = {}
// 此处拿到的props.route.params内属性的value被进行过了一次decode, 不符合预期,此处额外进行一次encode来与微信对齐
if (isObject(props.route.params)) {
for (let key in props.route.params) {
props.route.params[key] = encodeURIComponent(props.route.params[key])
for (const key in props.route.params) {
loadParams[key] = encodeURIComponent(props.route.params[key])
}
}
proxy.callHook(ONLOAD, [props.route.params || {}])
proxy.callHook(ONLOAD, [loadParams])
}
proxy.mounted()
return () => {
Expand Down

0 comments on commit 213c000

Please sign in to comment.