鸿蒙开发十二小时

let title:string='helld'
console.log('我说',title)
let age:number=8
console.log('我说',age)
let isLogin:boolean=true
console.log('我说',isLogin)
let num:string[]=['aa','ss','sw']
console.log('ww',num)
function star(){

  console.log('ss','@@')
  console.log('ss','@@')
  console.log('ss','@@')
}
star()
//定义接口
interface ps{
  name:string
  weight:number
  age:number
}
//基于接口定义对象
let ym:ps={
  name:'哑巴分泌',
  weight:34,
  age:12
}
//获取对象的属性值 对象名。属性值
console.log(')',ym.name)
//定义接口
interface ps{
  name:string
  weight:number
  age:number
  sing:(song:string)=>void
  dance:()=>void
}
//基于接口定义对象
let ym:ps={
  name:'哑巴分泌',
  weight:34,
  age:12,
  sing:(song:string)=>{
    console.log('ss','ssss',song)
  },
  dance:()=>{
    console.log("sssss",'qqqq')
  }
}
//获取对象的属性值 对象名。属性值
ym.sing("sss")
ym.dance()
let yu:number | string =100
enum yy {
  Red='#ff0f29',
  Orange='#ff7100'
}

let color:yy =yy.Red

界面开发

@Entry
@Component
struct Index {
  @State message: string = '啥地方';
  build() {
    RelativeContainer() {
      Text(this.message)
        .id('HelloWorld')
        .fontSize(50)
        .fontWeight(FontWeight.Bold)
        .fontColor(Color.Blue)
        .alignRules({
          center: { anchor: '__container__', align: VerticalAlign.Center },
          middle: { anchor: '__container__', align: HorizontalAlign.Center }
        })
    }
    .height('100%')
    .width('100%')
  }
}
@Entry
@Component
struct Index {
  @State message: string = '啥地方';
  build() {
    Column(){
      Text('小说简介')
        .width('100%')
        .height(40)
        .fontSize(20)
        .fontWeight(FontWeight.Bold)
      Row(){
        Text('都市')
          .width(50)
          .height(30)
          .backgroundColor(Color.Orange)
        Text('生活')
          .width(50)
          .height(30)
          .backgroundColor(Color.Orange)
        Text('情感')
          .width(50)
          .height(30)
          .backgroundColor(Color.Orange)
        Text('男频')
          .width(50)
          .height(30)
          .backgroundColor(Color.Orange)
      }
     .width('100%')
    }
    .width('100%')



  }
}
@Entry
@Component
struct Index {
  @State message: string = '啥地方';
  build() {
   Column(){
     Text('我爱学习,我爱中国')
       .width('100%')
       .height(40)
       .fontSize(24)
     Row(){
       Text('置顶  ')
         .fontColor('#df3c50')
       Text('新华社  ')
         .fontColor('#a1a1a1')
       Text('1086评论')
         .fontColor('#a1a1a1')
     }

     .width('100%')
   }
   .width('100%')
  }
}
@Entry
@Component
struct Index {
  @State message: string = '啥地方';
  build() {
   Column(){
     Text('我在家,家在哪')
       .width('100%')
       .fontSize(20)
       .fontWeight(FontWeight.Bold)
     Text('拦截 28608.recommend_list.baidu.com常见颜色十六进制代码 啊啊啊啊啊啊啊啊啊文啊啊啊啊啊啊啊啊啊啊啊啊啊文啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊')
       .width('100%')
       .lineHeight(24)
       .textOverflow({
         overflow:TextOverflow.Ellipsis
       })
       .maxLines(2)
   }
   .width('100%')
  }
}
@Entry
@Component
struct Index {
  @State message: string = '啥地方';
  build() {
   Column() {
     Image('https://k.sinaimg.cn/n/sinakd20240916s/290/w1080h810/20240916/78b4-c9372aa67be3954ac0aa4c8e55278d2e.jpg/w700d1q75cms.jpg?by=cms_fixed_width')
       .height(70)
   }
  }
}
@Entry
@Component
struct Index {
  @State message: string = '啥地方';
  build() {
   Column() {
     Image($r('app.media.background'))
       .width(200)
     Text('龙年打击')
       .width(200)
     Row(){
       Image($r('app.media.startIcon'))
         .width(20)
       Text('代码哥')
     }
     .width(200)
   }
  }
}
@Entry
@Component
struct Index {
  @State message: string = '啥地方';
  build() {
   Column({space:15}){
     TextInput({
       placeholder:'qingshutu'
     })
     TextInput({
       placeholder:'qqqqqqq'
     }).type(InputType.Password)
     Button('ss')
       .width(200)
   }
  }
}
@Entry
@Component
struct Index {
  @State message: string = '啥地方';
  build() {
   Column({space:15}){
     Image($r('app.media.startIcon'))
       .width(50)
     TextInput({
       placeholder:'qqq'
     })
     TextInput({
       placeholder:'www'
     }).type(InputType.Password)
     Button('ee')
       .width('100%')
     Row({space:15})
     {
       Text('qqqq')
       Text('www')
     }
   }


   .width('100%')
    .padding(20)
  }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

C—328G

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值