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

申请网站备案要多久重庆城市建设网站

申请网站备案要多久,重庆城市建设网站,中国网络服务商,长沙有名的公司一、前言 Require是校验Prop、State、Provide、BuilderParam和普通变量(无状态装饰器修饰的变量)是否需要构造传参的一个装饰器。 说明 从API version 11开始对Prop/BuilderParam进行校验。 从API version 11开始#xff0c;该装饰器支持在元服务中使用。 从API version 12开…一、前言 Require是校验Prop、State、Provide、BuilderParam和普通变量(无状态装饰器修饰的变量)是否需要构造传参的一个装饰器。 说明 从API version 11开始对Prop/BuilderParam进行校验。 从API version 11开始该装饰器支持在元服务中使用。 从API version 12开始对State/Provide/普通变量(无状态装饰器修饰的变量)进行校验。 二、概述 当Require装饰器和Prop、State、Provide、BuilderParam、普通变量(无状态装饰器修饰的变量)结合使用时在构造该自定义组件时Prop、State、Provide、BuilderParam和普通变量(无状态装饰器修饰的变量)必须在构造时传参。 三、限制条件 Require装饰器仅用于装饰struct内的Prop、State、Provide、BuilderParam和普通变量(无状态装饰器修饰的变量)。 四、使用场景 当Child组件内使用Require装饰器和Prop、State、Provide、BuilderParam和普通变量(无状态装饰器修饰的变量)结合使用时父组件TestRequire在构造Child时必须传参否则编译不通过。 TestRequire.ets代码 Entry Component struct TestRequire {State message: string Hello World;BuilderbuildTest() {Row() {Text(Hello, world).fontSize(20)}}build() {Row() {Child({regular_value: this.message,state_value: this.message,provide_value: this.message,initMessage: this.message,message: this.message,buildTest: this.buildTest,initBuildTest: this.buildTest})}.margin({ top: 30 })} }Component struct Child {BuilderbuildFunction() {Column() {Text(initBuilderParam).fontSize(20)}}Require regular_value: string Hello;Require State state_value: string Hello;Require Provide provide_value: string Hello;Require BuilderParam buildTest: () void;Require BuilderParam initBuildTest: () void this.buildFunction;Require Prop initMessage: string Hello;Require Prop message: string;build() {Column() {Text(this.initMessage).fontSize(30)Text(this.message).fontSize(30)this.initBuildTest();this.buildTest();}.width(100%).height(100%)} }效果图 使用ComponentV2修饰的自定义组件ChildPage通过父组件ParentPage进行初始化因为有Require装饰所以父组件必须进行构造赋值。 ObservedV2 class Info {Trace name: string ;Trace age: number 0; }ComponentV2 struct ChildPage {Require Param childInfo: Info new Info();Require Param state_value: string Hello;build() {Column() {Text(ChildPage childInfo name :${this.childInfo.name}).fontSize(20).fontWeight(FontWeight.Bold)Text(ChildPage childInfo age :${this.childInfo.age}).fontSize(20).fontWeight(FontWeight.Bold)Text(ChildPage state_value age :${this.state_value}).fontSize(20).fontWeight(FontWeight.Bold)}} }Entry ComponentV2 struct ParentPage {info1: Info { name: Tom, age: 25 };label1: string Hello World;Local info2: Info { name: Tom, age: 25 };Local label2: string Hello World;build() {Column() {Text(info1: ${this.info1.name} ${this.info1.age}) // Text1.fontSize(30).fontWeight(FontWeight.Bold)ChildPage({ childInfo: this.info1, state_value: this.label1}) // 调用自定义组件Line().width(100%).height(5).backgroundColor(#000000).margin(10)Text(info2: ${this.info2.name} ${this.info2.age}) // Text2.fontSize(30).fontWeight(FontWeight.Bold)ChildPage({ childInfo: this.info2, state_value: this.label2}) // 调用自定义组件Line().width(100%).height(5).backgroundColor(#000000).margin(10)Button(change info1info2).onClick(() {this.info1 { name: Cat, age: 18} // Text1不会刷新原因是没有装饰器修饰监听不到值的改变。this.info2 { name: Cat, age: 18} // Text2会刷新原因是有装饰器修饰可以监听到值的改变。this.label1 Luck; // 不会刷新原因是没有装饰器修饰监听不到值的改变。this.label2 Luck; // 会刷新原因是有装饰器修饰可以监听到值的改变。})}} }效果图 五、错误场景 Entry Component struct Index {State message: string Hello World;Builder buildTest() {Row() {Text(Hello, world).fontSize(30)}}build() {Row() {Child()}} }Component struct Child {Builder buildFunction() {Column() {Text(initBuilderParam).fontSize(30)}}// 使用Require必须构造时传参。Require regular_value: string Hello;Require State state_value: string Hello;Require Provide provide_value: string Hello;Require BuilderParam initBuildTest: () void this.buildFunction;Require Prop initMessage: string Hello;build() {Column() {Text(this.initMessage).fontSize(30)this.initBuildTest();}} }
http://www.hkea.cn/news/14445560/

相关文章:

  • 网站建设工作小组分工东莞网页网站制作
  • 免费代理服务器网站京津冀协同发展规划图
  • 整站优化关键词排名南京网站优化步骤
  • php网站建设论文答辩做代理记账网站
  • 做盗版小说网站怎么样wordpress 访问源端口号
  • 城市建设杂志社网站网站建设税率
  • 著名设计师网站微信开发者平台官网登录
  • 网站建设图片尺寸wordpress 附件上传插件下载
  • 中关村在线官方网站德国建设部网站
  • 企业模板网站建设优势分析html5播放器
  • 网络营销服务商天津做网站优化公司
  • 电子商务网站开发的基本要求无锡响应式网站
  • 免费生成网站的app做自行车网站应该注意什么
  • 知识付费网站开发教程软件商城安装
  • 网站开发作业ps做网站要多大
  • 常州网站制作推广wordpress 跑马灯插件
  • 去除 做网站就用建站之星泰安网站建设优化技术
  • 济南php网站开发南京网站制作公司排名
  • 盐城seo网站优化软件重庆万州网站建设公司电话
  • 网站开发图片188旅游网站管理系统6.0模板
  • 有用建站宝盒做网站的吗哈尔滨网络优化推广公司
  • 建设银行怎么加入信用网站广州智能建站
  • 做视频怎么去除网站做网站怎么存放视频
  • 找外包公司做网站的好处和坏处广州定制网站建设公司
  • 网站建设线上线下双服务器有个找人做任务赚返佣的网站
  • 苏州优化网站排名服务器租用相关网站
  • 上市公司数据查询网站金湖网页设计多少钱
  • 有没有建筑学做区位分析的网站微购物网站建设
  • 图片网站建设网络营销策划方案ppt模板
  • 成都高新区制作网站安卓软件开发工程师