陈剑华

fix: defaultWebPage

... ... @@ -19,6 +19,7 @@ export struct WdWebComponent {
receiveH5SendToNativeData: (dataString:string | undefined) => void = () =>{
}
@Prop isDefaultPage: boolean = false;
@Prop webUrl: string = ''
@Prop @Watch('onReloadStateChanged') reload: number = 0
@Link isPageEnd: boolean
... ... @@ -56,9 +57,11 @@ export struct WdWebComponent {
return this.onLoadIntercept(url);
})
// 添加之后影响了专题详情页中 点击稿件进详情的操作,这里先临时注释
// .onControllerAttached(() => {
// this.webviewControl.setCustomUserAgent(this.userAgent);
// })
.onControllerAttached(() => {
if (this.isDefaultPage) {
this.webviewControl.setCustomUserAgent(this.userAgent);
}
})
}
}
... ...
... ... @@ -38,7 +38,8 @@ struct DefaultWebPage {
WdWebComponent({
webviewControl: this.webviewControl,
webUrl: this.webUrl,
isPageEnd: $isPageEnd
isPageEnd: $isPageEnd,
isDefaultPage: true
})
}.layoutWeight(1)
}
... ...