当前位置: 首页> 娱乐> 八卦 > 建行app下载官网_专业网络推广机构_名优网站关键词优化_网络营销中的seo与sem

建行app下载官网_专业网络推广机构_名优网站关键词优化_网络营销中的seo与sem

时间:2025/7/11 23:46:54来源:https://blog.csdn.net/rogabet/article/details/142557827 浏览次数:0次
建行app下载官网_专业网络推广机构_名优网站关键词优化_网络营销中的seo与sem

Index.ets:

// 导入页面路由模块
import router from '@ohos.router';
@Entry
@Component
struct Index {@State message: string = '我是没头脑'build() {Row() {Column() {Text(this.message).fontSize(50).fontWeight(FontWeight.Bold) // 添加一个按钮Button() {Text("Open Page").fontSize(30).fontWeight(FontWeight.Bold)}.type(ButtonType.Capsule).margin({top: 20}).backgroundColor('#ff9900').width('80%').height('5%')// 给按钮绑定点击事件.onClick(()=>{console.log("点击了按钮") // 跳转第二个页面router.pushUrl({url: 'pages/second' }).then(()=>{console.log("成功跳转了");})})}.width('100%')}.height('100%')}
}

second.ets:

// Second.ets
import router from '@ohos.router';
@Entry
@Component
struct Second {@State message: string = '你是不高兴'build() {Row() {Column() {Text(this.message).fontSize(50).fontWeight(FontWeight.Bold)Button() {Text('Back').fontSize(25).fontWeight(FontWeight.Bold)}.type(ButtonType.Capsule).margin({top: 20}).backgroundColor('#ff9900').width('80%').height('5%') // 绑定点击事件.onClick(()=>{// 返回上一页面router.back()})}.width('100%')}.height('100%')}
}

代码如上。

开发工具地址:

DevEco Studio-HarmonyOS Next Beta版-华为开发者联盟

-----------------

C:\Users\rogabet\DevEcoStudioProjects\hwrogachat\AppScope

app.json5应用公共配置信息

{
  "app": {
    "bundleName": "com.example.hwrogachat",
    "vendor": "example",
    "versionCode": 1000000,
    "versionName": "1.0.0",
    "icon": "$media:app_icon",
    "label": "$string:app_name"
  }
}
----------------------

C:\Users\rogabet\DevEcoStudioProjects\hwrogachat\entry\src\main

module.json5当前模块配置信息

{
  "module": {
    "name": "entry",
    "type": "entry",
    "description": "$string:module_desc",
    "mainElement": "EntryAbility",
    "deviceTypes": [
      "phone"
    ],
    "deliveryWithInstall": true,
    "installationFree": false,
    "pages": "$profile:main_pages",
    "abilities": [
      {
        "name": "EntryAbility",
        "srcEntry": "./ets/entryability/EntryAbility.ets",
        "description": "$string:EntryAbility_desc",
        "icon": "$media:layered_image",
        "label": "$string:EntryAbility_label",
        "startWindowIcon": "$media:startIcon",
        "startWindowBackground": "$color:start_window_background",
        "exported": true,
        "skills": [
          {
            "entities": [
              "entity.system.home"
            ],
            "actions": [
              "action.system.home"
            ]
          }
        ]
      }
    ],
    "extensionAbilities": [
      {
        "name": "EntryBackupAbility",
        "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets",
        "type": "backup",
        "exported": false,
        "metadata": [
          {
            "name": "ohos.extension.backup",
            "resource": "$profile:backup_config"
          }
        ],
      }
    ]
  }
}

--------------------------

C:\Users\rogabet\DevEcoStudioProjects\hwrogachat\entry\src\main\resources\base\profile

main_pages.json页面配置

{
  "src": [
    "pages/Index",
    "pages/second"
  ]
}

关键字:建行app下载官网_专业网络推广机构_名优网站关键词优化_网络营销中的seo与sem

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: