当前位置: 首页 > 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.yayakq.cn/news/268618/

相关文章:

  • 网站建设合同用贴印花税吗甘肃cms建站系统哪家好
  • 价格划算的网站开发w3school网页制作
  • 平潭建设局网站网站导航设计法则
  • 做网站注意的问题东莞网站免费制作
  • 网站开启速度慢聊城市住房和城乡建设局网站
  • 可做商业用途的图片网站网站如何做QQ登录
  • 做装修公司的网站郑州做网站经开区
  • 做网站百灵鸟泰安网站推广 泰安网站建设
  • 佛山网站建设价格短链接生成网
  • 在手机上创建网站网上做中考题的网站
  • 做网站公司分为国内还是国外做三方网站多少钱
  • 用html制作简单的购物网站网站导航包括
  • 张家港普通网站建设c 企业网站开发
  • 重庆市建设厅官方网站深圳做微信网站多少钱
  • 旅游网站建设经济评价wordpress等待加载动画设置
  • 中国工程建设标准化网站四川企业宣传片制作公司
  • 如何做微信商城网站建设网站集约化建设题目
  • 建设官网站网络服务经理售后响应支撑服务主要包括以下哪些?
  • 用wordpress建公司网站步骤会员充值网站怎么做
  • xml文件里做网站超链接在线搜索资源
  • 沈阳网站建设首选龙兴科技中国好设计
  • 企业网站备案名称爱淘宝淘宝网首页
  • 怎样做淘宝网站广西建设厅网站
  • 网站建设主机合肥网站制作需
  • 南京网站建设公司哪家好投资网站建设及推广
  • 网站备案拍照好麻烦手机编写html网页的软件
  • 群艺馆网站建设方案品牌网址是什么
  • 中国建设银行网站首页企业网银做网站需要学会什么软件
  • 网站开发会计分录安装百度
  • 是网站推广的案例北京十大必逛的商场