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

网站搜索优化找哪家十大it教育培训机构排名

网站搜索优化找哪家,十大it教育培训机构排名,用bootstrap基础教程做的网站,广告制作与设计专业效果展示 这篇博文在《鸿蒙:从0到“Hello Harmony”》基础上实现两个Page页面跳转 1.构建第一个页面 第一个页面就是“Hello Harmony”,把文件名和显示内容都改一下,改成“FirstPage”,再添加一个“Next”按钮。 Entry Compone…

效果展示

这篇博文在《鸿蒙:从0到“Hello Harmony”》基础上实现两个Page页面跳转

1.构建第一个页面

第一个页面就是“Hello Harmony”,把文件名和显示内容都改一下,改成“FirstPage”,再添加一个“Next”按钮。

@Entry
@Component
struct FristPage {@State message1: string = "FirstPage"@State message2: string = 'Next'build() {Row() {Column() {Text(this.message1).fontSize(30).fontWeight(FontWeight.Bold).height("10%").margin({top: 0})Button(this.message2).fontSize(30).fontWeight(FontWeight.Bold).height('5%').type(ButtonType.Capsule).margin({top: 30}).backgroundColor("#0D9FFB").width('50%').height('5%')}.width('100%')}.height('100%')}
}

在编辑窗口右上角的侧边工具栏,点击Previewer,打开预览器。第一个页面效果如下图所示:

2.构建第二个页面

1.在“entry > src > main > ets > pages”目录下,新建SecondPage.ets

同样,实现一个文本和一个Button按钮

@Entry
@Component
struct SecondPage {@State message1: string = 'SecondPage'@State message2: string = 'Back'build() {Row() {Column() {Text(this.message1).fontSize(30).fontWeight(FontWeight.Bold)Button(this.message2).fontSize(30).fontWeight(FontWeight.Bold).height('5%').type(ButtonType.Capsule).margin({top: 30}).backgroundColor("#0D9FFB").width('50%').height('5%')}.width('100%')}.height('100%')}
}

Previewer效果:

3.配置路由

配置第二个页面的路由。

在“Project”窗口,打开“entry > src > main > resources > base > profile”,

main_pages.json文件中的“src”下配置第二个页面的路由“pages/second”

代码如下:

{"src": ["pages/FirstPage","pages/SecondPage"]
}

4.实现页面跳转

​页面间的导航可以通过页面路由router来实现。

页面路由router根据页面url找到目标页面,从而实现跳转。

使用页面路由需要导入router模块。

(1).第一个页面跳转到第二个页面

在第一个页面中,跳转按钮绑定onClick事件,点击按钮时跳转到第二页。

FirstPage.ets”文件的代码如下:

// @ohos.router模块功能从API version 8开始支持,请使用对应匹配的SDK
import router from '@ohos.router';@Entry
@Component
struct FristPage {@State message1: string = "FirstPage"@State message2: string = 'Next'build() {Row() {Column() {Text(this.message1).fontSize(30).fontWeight(FontWeight.Bold).height("10%").margin({top: 0})Button(this.message2).fontSize(30).fontWeight(FontWeight.Bold).height('5%').type(ButtonType.Capsule).margin({top: 30}).backgroundColor("#0D9FFB").width('50%').height('5%').onClick(() => {console.info(`Succeeded in clicking the 'Next' button.`)try {router.pushUrl({ url: 'pages/SecondPage' })console.info('Succeeded in jumping to the second page.')} catch (err) {console.error(`Failed to jump to the second page.Code is ${err.code}, message is ${err.message}`)}})}.width('100%')}.height('100%')}
}

(1).第二个页面跳转到第一个页面

在第二个页面中,返回按钮绑定onClick事件,点击按钮时返回到第一页。

“SecondPage.ets”文件的示例如下:

import router from '@ohos.router';@Entry
@Component
struct SecondPage {@State message1: string = 'SecondPage'@State message2: string = 'Back'build() {Row() {Column() {Text(this.message1).fontSize(30).fontWeight(FontWeight.Bold)Button(this.message2).fontSize(30).fontWeight(FontWeight.Bold).height('5%').type(ButtonType.Capsule).margin({top: 30}).backgroundColor("#0D9FFB").width('50%').height('5%').onClick(() => {console.info(`Succeeded in clicking the 'Next' button.`)try {router.pushUrl({ url: 'pages/FirstPage' })console.info('Succeeded in jumping to the second page.')} catch (err) {console.error(`Failed to jump to the second page.Code is ${err.code}, message is ${err.message}`)}})}.width('100%')}.height('100%')}
}

5.实现效果

如开头展示

http://www.15wanjia.com/news/36182.html

相关文章:

  • 中国建设银行网站 党费网络销售怎么聊客户
  • 有没有类似一起做网店的网站今日国际新闻事件
  • 做视频的网站靠什么收入搜索引擎营销的主要方法
  • seo网站关键词优化排名网站推广优化外包公司
  • 网站被百度收录吗seoul是什么意思
  • 什么什么云用来做网站纹身网站设计
  • 江苏seo网站排名优化网站建设百度推广
  • 公司部门分工关键词优化排名网站
  • 营销型网站建设的定义磁力搜索器 磁力猫
  • 柳州网站建设公司泰安seo培训
  • 上海人才网官网站首页必应搜索
  • 如何在网站做电子杂志百度关键词刷排名软件
  • 做网站在厦门排前5名附近电商培训班
  • 网站开发的前端和后端有哪些框架网站域名查询系统
  • 陕西西安网站建设seo论坛
  • 网站用户账号ip查询产品营销推广的方案
  • 湖州建设公司网站广东深圳疫情最新消息
  • 网站建设教程 迅雷下载百度seo工作室
  • 有没有做外贸的网站啊seo内部优化方案
  • 收企业做网站备案seo网站排名的软件
  • 商务网站建设与维护试卷网络培训中心
  • 网站版面做的很好的公司广州seo排名外包
  • web建立虚拟网站互联网广告投放代理公司
  • 知名网站建设在哪里重庆企业免费建站
  • 免费搭建个人网站的3种实用方法小程序平台
  • 填空秒懂网站网址导航
  • wordpress win8广州网站优化外包
  • 上传网站备案信息真实性核验单一站式软文发布推广平台
  • 重庆网站备案最快几天江门搜狗网站推广优化
  • 网站群管理系统哪个好网络营销的一般流程