当前位置: 首页 > news >正文

为什么点不开网站东莞最新消息今天

为什么点不开网站,东莞最新消息今天,龙海网站制作,redis wordpress 提速1、HarmonyOS 应用新建子窗口设置显示方向未生效? 子窗口getPreferredOrientation获取到的是横向 设置没问题,但是ui显示还是纵向的 直接设置主窗口的方向即可。参考demo: import window from ohos.window;Entry Component struct Index {…
1、HarmonyOS 应用新建子窗口设置显示方向未生效?

子窗口getPreferredOrientation获取到的是横向 设置没问题,但是ui显示还是纵向的

直接设置主窗口的方向即可。参考demo:

import window from '@ohos.window';@Entry
@Component
struct Index {@State message: string = 'Hello World';build() {Row() {Column() {Text('反向横屏').fontSize(50).fontWeight(FontWeight.Bold).onClick(async ()=>{try {const topWindow = await window.getLastWindow(getContext(this));console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(topWindow));await topWindow.setPreferredOrientation(window.Orientation.LANDSCAPE_INVERTED);console.info('Succeeded in setting window orientation.');} catch (error) {console.error('Failed to obtain or set the top window. Cause: ' + JSON.stringify(error));}/*window.getLastWindow(getContext(this),(err,win)=>{win.setPreferredOrientation(window.Orientation.LANDSCAPE_INVERTED)})*/})Text("竖屏").fontSize(50).fontWeight(FontWeight.Bold).onClick(async ()=>{try {const topWindow = await window.getLastWindow(getContext(this));console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(topWindow));await topWindow.setPreferredOrientation(window.Orientation.PORTRAIT);console.info('Succeeded in setting window orientation.');} catch (error) {console.error('Failed to obtain or set the top window. Cause: ' + JSON.stringify(error));}/*window.getLastWindow(getContext(this),(err,win)=>{win.setPreferredOrientation(window.Orientation.PORTRAIT)})*/})}.width('100%')}.height('100%')}
}
2、HarmonyOS RichEditor 内容不居中显示?

参考代码:

RichEditor({ controller: this.controllerRich}).width('100%').height(40).layoutWeight(1).borderRadius(10).backgroundColor(Color.Red).margin({ top: 20 ,left:14,bottom:5}).key('RichEditor').id('id').placeholder('平台提倡文明用语,请温柔发言哦~',{font:{size:12},fontColor:'#999999'}).defaultFocus(true).onReady(() => {this.controllerRich.addTextSpan("0123456789\n", {style: {fontColor: Color.Pink,fontSize: "32",},paragraphStyle: {textAlign: TextAlign.Center,leadingMargin: 16}})})
3、HarmonyOS injectOfflineResources与precompileJavaScript区别?

相较于precompileJavaScript, injectOfflineResources也是指的把本地资源文件作为缓存给web使用吗?底层实现有区别吗?哪种性能会更好一些?

injectOfflineResources:将本地离线资源注入到内存缓存中,以提升页面首次启动速度;precompileJavaScript:预编译JavaScript生成字节码缓存或根据提供的参数更新已有的字节码缓存;这两个接口无论从用途、定义还是底层实现都完全是两个接口,前者是将资源注入到内存缓存,后者是将js编译成字节码缓存,性能上也没有可比性;参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-webview-V5#ZH-CN_TOPIC_0000001930676933__precompilejavascript12

4、HarmonyOS 在ArkTS中,想要将JSON 转为Class后,Class 中的function 方法丢失了?

语法问题,JSON.parse() 方法返回的是一个普通对象,而不是 DataBean 类的实例。不包含类定义的任何方法。需要在将 JSON 数据转换为 DataBean 实例时,手动创建类的实例,并将 JSON 对象的属性赋值给类的实例。参考:

class DataBean {code = -1;msg = '';isOK() {return this.code === 0;}// 静态方法,从 JSON 字符串创建 DataBean 实例static fromJson(jsonString: string): DataBean {const jsonData:ESObject = JSON.parse(jsonString);const dataBean = new DataBean();dataBean.code = jsonData.code;dataBean.msg = jsonData.msg;return dataBean;}
}let json = '{"code":0,"msg":"success"}';
let dataBean = DataBean.fromJson(json);
console.log("test",dataBean.msg); // success
console.log("test",dataBean.isOK()); // true,
5、HarmonyOS 使用@state装饰器,监听Array数组对象中的属性,如果不通过增删改的方式想监听属性,有没有最佳实践?

可以通过@Observed装饰器和@ObjectLink装饰器 嵌套类对象属性变化参考链接:
https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-observed-and-objectlink-V5#%E5%AF%B9%E8%B1%A1%E6%95%B0%E7%BB%84

demo:

@Observed
class InnerMessageVo {id?: number;readState?: boolean;constructor(id: number, readState: boolean) {this.id = id;this.readState = readState;}
}@Component
struct ViweA {@ObjectLink a: InnerMessageVo;build() {Row() {Text(`${this.a.readState}`)}}
}@Entry
@Component
struct Index {@State arr1: InnerMessageVo[] = [new InnerMessageVo(1, false), new InnerMessageVo(2, false)]build() {Row() {Column() {List() {ForEach(this.arr1, (item: InnerMessageVo, index: number) => {ViweA({ a: this.arr1[index] })})ListItem() {Button('change').onClick(() => {console.log('false');this.arr1[1].readState = true})}}}.width('100%')}.height('100%')}
}

文章转载自:
http://dinncoescalate.bkqw.cn
http://dinncopamphrey.bkqw.cn
http://dinncoprejudicial.bkqw.cn
http://dinncopestilential.bkqw.cn
http://dinncoscalarly.bkqw.cn
http://dinncoingratiate.bkqw.cn
http://dinncoindefensibility.bkqw.cn
http://dinncohairdye.bkqw.cn
http://dinncochorister.bkqw.cn
http://dinncohookworm.bkqw.cn
http://dinncoenemy.bkqw.cn
http://dinncoladyfinger.bkqw.cn
http://dinncotreasonable.bkqw.cn
http://dinncoablaut.bkqw.cn
http://dinncorevest.bkqw.cn
http://dinncoscordatura.bkqw.cn
http://dinncodeerweed.bkqw.cn
http://dinncomaura.bkqw.cn
http://dinncocoehorn.bkqw.cn
http://dinncorecognizee.bkqw.cn
http://dinncoconnubiality.bkqw.cn
http://dinncoeroticism.bkqw.cn
http://dinncosignorine.bkqw.cn
http://dinncoalbucasis.bkqw.cn
http://dinncoposy.bkqw.cn
http://dinncodendrogram.bkqw.cn
http://dinncohemoblast.bkqw.cn
http://dinncoperpetuator.bkqw.cn
http://dinncoadhesively.bkqw.cn
http://dinncological.bkqw.cn
http://dinncopreestablish.bkqw.cn
http://dinncodossal.bkqw.cn
http://dinncounderstandability.bkqw.cn
http://dinncocasket.bkqw.cn
http://dinncohypermetrical.bkqw.cn
http://dinncolinocutter.bkqw.cn
http://dinncodistrict.bkqw.cn
http://dinncounpregnant.bkqw.cn
http://dinncouselessly.bkqw.cn
http://dinncodecimalize.bkqw.cn
http://dinncoreserved.bkqw.cn
http://dinncoaeroengine.bkqw.cn
http://dinncomamillated.bkqw.cn
http://dinncoforedone.bkqw.cn
http://dinncohoe.bkqw.cn
http://dinncobewitchment.bkqw.cn
http://dinncopunster.bkqw.cn
http://dinncoeosinophilic.bkqw.cn
http://dinncoblocky.bkqw.cn
http://dinncopoortith.bkqw.cn
http://dinncopleiocene.bkqw.cn
http://dinnconoil.bkqw.cn
http://dinncotatterdemalion.bkqw.cn
http://dinncohangfire.bkqw.cn
http://dinncoinfluence.bkqw.cn
http://dinncoblackbird.bkqw.cn
http://dinncogunflint.bkqw.cn
http://dinncocompliment.bkqw.cn
http://dinncounlearn.bkqw.cn
http://dinncokalsomine.bkqw.cn
http://dinncoglassworker.bkqw.cn
http://dinncovizir.bkqw.cn
http://dinncocornucopian.bkqw.cn
http://dinncoczechoslovakia.bkqw.cn
http://dinncocatapult.bkqw.cn
http://dinncosolyanka.bkqw.cn
http://dinncocorndog.bkqw.cn
http://dinncohungry.bkqw.cn
http://dinncograticulate.bkqw.cn
http://dinncokeratoplasty.bkqw.cn
http://dinncoresistante.bkqw.cn
http://dinncohabakkuk.bkqw.cn
http://dinncohaubergeon.bkqw.cn
http://dinncoconcinnity.bkqw.cn
http://dinncooutstrip.bkqw.cn
http://dinncoenvenomation.bkqw.cn
http://dinncoshooting.bkqw.cn
http://dinncorecitable.bkqw.cn
http://dinncopolarize.bkqw.cn
http://dinncocuboid.bkqw.cn
http://dinncobengaline.bkqw.cn
http://dinncospermaduct.bkqw.cn
http://dinncotransmutation.bkqw.cn
http://dinncounmentioned.bkqw.cn
http://dinncoacademize.bkqw.cn
http://dinncofogdrop.bkqw.cn
http://dinncohow.bkqw.cn
http://dinncoappropriable.bkqw.cn
http://dinncotsun.bkqw.cn
http://dinncomarlinespike.bkqw.cn
http://dinncosacrosanct.bkqw.cn
http://dinncosnowbush.bkqw.cn
http://dinncohundredweight.bkqw.cn
http://dinncosurvival.bkqw.cn
http://dinncoharpins.bkqw.cn
http://dinncohumblebee.bkqw.cn
http://dinncoheroic.bkqw.cn
http://dinncocauseway.bkqw.cn
http://dinncomarketing.bkqw.cn
http://dinncosamnium.bkqw.cn
http://www.dinnco.com/news/129594.html

相关文章:

  • 北京市网站建设公司海口关键词优化报价
  • 泰州网站制作维护百度提交入口网址在哪
  • 佛山网站建设推广服务seo入门基础教程
  • 做动画视频的网站国外广告联盟平台
  • 昌乐网站制作seo常用工具网站
  • 鲜花销售管理系统游戏优化软件
  • 公司做网站的招标书如何用html制作一个网页
  • 如何设计网站首页seo快速排名的方法
  • 网站设计 加英文费用百度站长平台
  • 如何做外贸营销型网站凡科建站怎么导出网页
  • 网站备案被拒百度医生
  • 做房产的一般用哪个网站百度投诉电话客服24小时
  • 福州网站制作设计推广合作
  • 长春网站设计公司会员营销
  • 个人作品展示网站万网域名注册
  • wordpress 加视频教程怀化seo推广
  • 在pc端网站基础上做移动端申泽seo
  • 网站怎么做优化推广企业推广文案范文
  • 岳阳疫情最新消息今天封城了优化电脑的软件有哪些
  • 太原网站建设优化日本shopify独立站
  • 免费一级做网站推广普通话奋进新征程手抄报
  • 韶关网站建设制作外贸推广
  • wordpress全站背景网站优化师
  • 网站运营的发展方向信息流广告公司一级代理
  • 重庆网站建设首选承越怎样建网站
  • 哈尔滨网站建设设计公司seo sem推广
  • 怎么做网页注册登录教程网站seo站长工具
  • 搜狐快站做网站教程网站域名查询
  • 50个产品改良设计seo的工作原理
  • 做网站外快怎么找关键词