Skip to content

Commit

Permalink
fix: 修复react hash 模式下异常 (#155)
Browse files Browse the repository at this point in the history
close #151 
Co-authored-by: yiludege <821170693@qq.com>
  • Loading branch information
yiludege authored Sep 17, 2022
1 parent bf37422 commit 085687c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/wujie-core/src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ export function proxyGenerator(
warn(WUJIE_TIPS_RELOAD_DISABLED);
return () => null;
}
if (propKey === "replace") {
return new Proxy(location[propKey], {
apply(replace, _ctx, args) {
return replace.call(location, args[0]?.replace(appHostPath, mainHostPath));
},
});
}
return getTargetValue(location, propKey);
},
set: function (_fakeLocation, propKey, value) {
Expand Down

0 comments on commit 085687c

Please sign in to comment.