Skip to content

Commit

Permalink
修正settitle合丢代码
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcuijuan committed Dec 23, 2024
1 parent 562d644 commit ca907fe
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const _WebView = forwardRef<HandlerRef<WebView, WebViewProps>, WebViewProps>((pr
}
});
}
true;
`
const _changeUrl = function (navState: WebViewNavigation) {
if (navState.navigationType) { // navigationType这个事件在页面开始加载时和页面加载完成时都会被触发所以判断这个避免其他无效触发执行该逻辑
Expand Down Expand Up @@ -211,16 +212,15 @@ const _WebView = forwardRef<HandlerRef<WebView, WebViewProps>, WebViewProps>((pr
onError: _error
})
}
extendObject(events, {
onMessage: _message
})

return createElement(Portal, null, createElement(WebView, extendObject({
style: defaultWebViewStyle,
source: { uri: src },
ref: webViewRef,
javaScriptEnabled: true,
onNavigationStateChange: _changeUrl
onNavigationStateChange: _changeUrl,
onMessage: _message,
injectedJavaScript: injectedJavaScript
}, events)))
})

Expand Down

0 comments on commit ca907fe

Please sign in to comment.