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

做十个网站淘宝定向推广

做十个网站,淘宝定向推广,地域文化创意产网站建设规则,企业做网站营销的四大途径arkts是声名式UI DevEcoStudio的右侧预览器可以预览。有个TT的图标可以看布局的大小。和html的布局浏览很像。 上图布局对应的代码: Entry //入口 Component struct Index {State message: string Hello Harmonyos //State 数据改变了也刷新的标签build() {Row()…

arkts是声名式UI

DevEcoStudio的右侧预览器可以预览。有个TT的图标可以看布局的大小。和html的布局浏览很像。

上图布局对应的代码:


@Entry //入口
@Component
struct Index {@State message: string = 'Hello Harmonyos' //@State 数据改变了也刷新的标签build() {Row() {Column() {Text(this.message).fontSize(30).margin(10).padding(20).backgroundColor("#333333").fontColor(Color.White).border({width:3,color:Color.Blue}).borderRadius(10).onClick(() => {console.log("点击了text")this.message = "text"}).fontWeight(FontWeight.Bold)Divider().margin(10)Button("click").width(100).height(50).onClick(this.read.bind(this))}.width('100%').height('50%')}.height('100%').width('90%')}// 方法多的话写到这里read() {console.log("我是button的点击事件")this.message = "button"}
}

新建页面的时候选择page。就会主动把该页面添加在路由中。

此处就是新建的页面的路由。和微信小程序是一样一样的。要加到这个page上。

1、自定义组件内,自定义构件函数。

@Builder 注释来实现

@Entry //入口
@Component
struct PageB {@State message: string = 'Hello World' //@State 数据改变了也刷新的标签build() {Row() {Column() {this.TextLabel("账号")this.TextLabel("密码")Divider().margin(10)Button("click").width(100).height(50).onClick(this.read.bind(this))}.width('100%').height('50%')}.height('100%').width('90%')}// 方法多的话写到这里read() {console.log("我是button的点击事件")this.message = "button"}@Builder//自定义组件内,自定义构件函数TextLabel(title:string ){Text(title+this.message).fontSize(16).margin(10).padding(10).width(200).height(50).backgroundColor("#333333").fontColor(Color.White).border({width:3,color:Color.Blue}).borderRadius(10).onClick(() => {this.message ="admin"}).fontWeight(FontWeight.Bold)}
}

2.全局自定义构建函数

@Entry //入口
@Component
struct PageB {@State message: string = 'Hello World' //@State 数据改变了也刷新的标签build() {Row() {Column() {TextLabel("账号")TextLabel("密码")Divider().margin(10)Button("click").width(100).height(50).onClick(this.read.bind(this))}.width('100%').height('50%')}.height('100%').width('90%')}// 方法多的话写到这里read() {console.log("我是button的点击事件")this.message = "button"}
}
@Builder//全局自定义构件函数
function TextLabel(title:string ){Text(title+this.message).fontSize(16).margin(10).padding(10).width(200).height(50).backgroundColor("#333333").fontColor(Color.White).border({width:3,color:Color.Blue}).borderRadius(10).onClick(() => {this.message ="admin"//在全局不建议去修改message}).fontWeight(FontWeight.Bold)
}

3、全局自定义函数实现简单的登录功能。采用引用传值,函数回调的方法。

@Entry //入口
@Component
struct PageB_build_param {@State message: string = 'Hello World' //@State 数据改变了也刷新的标签@State username: string = ''@State password: string = ''build() {Row() {Column() {text({ title: "用户", valueStr:this.username, cb: (value:string) => {this.username=value} })text({ title:"密码",valueStr:this.password,cb:(value:string)=>{this.password=value} })Divider().margin(10)Row() {Button("登录").fontSize(16).width(100).height(50).margin({ right: 10, left: 10 }).onClick(this.login.bind(this))Button("重置").fontSize(16).width(100).height(50).margin({ left: 10, right: 10 }).onClick(this.reset.bind(this))}}.width('100%').height('50%')}.height('100%').width('100%')}//登录login() {console.log(this.username+"----"+this.password)}reset() {this.username = ""this.password = ""}
}@Builder //全局自定义构件函数
function text($$: { title: string,valueStr: string,cb: (value: string) => void }) {Row() {Text($$.title).fontSize(16).margin(10).padding(10).width(80).textAlign(TextAlign.Center).height(50).backgroundColor("#333333").fontColor(Color.White).border({width: 3,color: Color.Blue}).borderRadius(10).fontWeight(FontWeight.Bold)TextInput({ text: $$.valueStr }).width(200).height(50).fontSize(16).onChange((value: string) => {$$.cb(value)})}.alignItems(VerticalAlign.Center)}

http://www.hrbkazy.com/news/12667.html

相关文章:

  • 自己做的网站如何让别人访问百度指数数据分析平台官网
  • 上海做网站多少费用2023年6月份疫情严重吗
  • 杭州律师优化网站关键词的技巧
  • 域名解析网站登录网站关键词收录查询
  • 网站建设公司长沙大连seo优化
  • 设计师自己做网站品牌营销案例分析
  • 做网站如何更新百度快照app运营
  • 网站建设台州竞价排名规则
  • 建设企业网站的流程爱站网为什么不能用了
  • 网站关键词选取网络营销八大工具
  • 青岛 网站制作长沙有实力的关键词优化价格
  • wordpress 群聊汉化版插件seo优化包括什么
  • 建设建材网站的目的新媒体营销方式有几种
  • 东营做营销型网站建设最新中国新闻
  • 昆明网站建设开发外包360指数查询工具
  • 洛阳有没有做家教的网站百度快照推广效果怎样
  • 沧州免费网站建设百度一下你就知道了百度
  • 包装设计网站哪个好用搜索引擎优化的方式
  • 学习做网站教程企业网站制作需要多少钱
  • 想在网上做设计接单有没有网站长沙专业seo优化公司
  • 龙游网站建设烟台seo快速排名
  • 网站制作哪些公司制作微信营销平台系统
  • 百度搜索页seo软件排行榜前十名
  • 做ppt接单的网站企业网站设计服务
  • 新疆疫情最新数据消息地图seo中国
  • cad图库大全素材免费下载关键词优化策略
  • 网站建站网站45133爱采购seo
  • 做国外贸易哪个网站好百度快照是什么意思
  • 外国做的中国动画视频网站中国网站访问量排行
  • wordpress的主题目录谷歌seo网站建设