@Entry
@Component
struct Index {
@State message: string = 'Hello World!!'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
.fontColor('red')
.onClick(() => {
this.message = '55555'
})
// 1.图像的处理
Image('https://pics0.baidu.com/feed/58ee3d6d55fbb2fb66c89c67f35244a14723dc86.jpeg?token=daed66277da9bbd3505826dae9f98e50&s=FC22A21F4762651D9CDCCBC80300E0BE')
.width(300)
Image($r('app.media.icon'))
.width(200)
}
.width('100%')
}
.height('100%')
}
}
在项目中找到module.json5文件,并打开
在其中设置申请网络权限
"requestPermissions": [
{
"name": "ohos.permission.INTERNET" //申请网络权限
}
]
如图: