当前位置: 首页> 财经> 产业 > 哪里有免费永久的云服务器_企业网站管理系统设置_网站排名顾问_湖北网站推广

哪里有免费永久的云服务器_企业网站管理系统设置_网站排名顾问_湖北网站推广

时间:2025/7/11 18:52:30来源:https://blog.csdn.net/sjw890821sjw/article/details/144794637 浏览次数:0次
哪里有免费永久的云服务器_企业网站管理系统设置_网站排名顾问_湖北网站推广
1、HarmonyOS 编译工具hvigor如何升级到"hvigorVersion": "4.2.0"版本?

可以手动更新到指定版本,参考链接如下:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-hvigor-plugin-V5

2、HarmonyOS 自定义Dialog如何修改弹出动画?
let anmDuration: number = 300;// 弹窗交互
@CustomDialog
struct CustomDialogExample {controller: CustomDialogController = new CustomDialogController({builder: CustomDialogExample({}),autoCancel: false})@State showFlag: Visibility = Visibility.Visible;@State isAutoCancel: boolean = false;textController: TextAreaController = new TextAreaController()build() {Column() {Row() {Text("自定义动画的弹窗")}.borderRadius(20).backgroundColor('#ff6288cb').height(200).width('100%')}.margin({top:10}).justifyContent(FlexAlign.Center).width('100%').height("100%").onClick(() => {console.log("dialogClick")if (this.isAutoCancel) {console.log("dialogClick2")this.cancel();}}).visibility(this.showFlag)// 定义进场出场转场动画效果.transition(TransitionEffect.OPACITY.animation({ duration: anmDuration }).combine(TransitionEffect.translate({ y: 500 })))}// 延迟关闭弹窗,让自定义的出场动画显示cancel() {this.showFlag = Visibility.Hiddenconsole.log("closeDialog")setTimeout(() => {this.controller.close()}, anmDuration)}
}@Entry
@Component
struct CustomDialogUser {@State isAutoCancel: boolean = true;dialogController: CustomDialogController = new CustomDialogController({builder: CustomDialogExample({ isAutoCancel: this.isAutoCancel }),autoCancel: this.isAutoCancel,customStyle: true,})build() {Column() {Button('click me').onClick(() => {this.dialogController.open()})}.width('100%').height('100%')}
}
3、HarmonyOS NavDestination中使用LocalStorage无效的问题?

项目中目前使用Navigation来做跳转。目前的问题是,用navigation打开的页面使用LocalStorage无效。

如果 用localStorage的话,@state修饰的关键词值的变化会导致页面跟着变化:

let para: Record<string, number> = { 'PropA': 47 };
let storage: LocalStorage = new LocalStorage(para);
@Entry(storage)
@Component
export default struct APage {@Consume('navigation') navigation: NavPathStack;@LocalStorageLink('PropA') storageLink: number =0;@State testid:number =0number: number = 0build() {NavDestination() {Column() {Text(JSON.stringify(this.testid)).fontSize("20vp").textAlign(TextAlign.Center).width('100%').height("20vp").onClick(() => {this.navigation.pushPath({name: "BPage"}, false);})Text("点击改变testId").fontSize("20vp").textAlign(TextAlign.Center).width('100%').height("20vp").margin({top:'20vp'}).onClick(() => {this.number++storage.set('PropA', this.number)this.testid =  storage.get('PropA') as number})}.width("100%").height('100%')}}
}
4、HarmonyOS Entry页面与子组件的生命周期执行顺序是怎么样的?

Entry的生命周期是aboutToAppear - build - onPageShow。那build中的子组件的aboutToAppear是在 build - component aboutToAppear - onPageShow,还是在build - onPageShow - component aboutToAppear。

参考页面和自定义组件生命周期文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-page-custom-components-lifecycle-V5

应用冷启动的初始化流程为:MyComponent aboutToAppear --> MyComponent build --> MyComponent onDidBuild–> Child aboutToAppear --> Child build --> Child onDidBuild --> Index onPageShow。
在这里插入图片描述

5、HarmonyOS 如何在h5页面中取到WebCookieManager中设置的cookies?

参考官方文档上webviewmanager的各项操作:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-basic-components-web-V5?catalogVersion=V5
使用getcookie等获取cookies的值。

关键字:哪里有免费永久的云服务器_企业网站管理系统设置_网站排名顾问_湖北网站推广

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: